Skip to content

Instantly share code, notes, and snippets.

@rschwabco
rschwabco / ng-hide-animation-mixin.scss
Created May 22, 2014 19:03
Ng-hide animation Sass Mixin
@mixin angular-animate-hide($duration,$property,$easing,$min-val,$max-val){
transition :$duration $property $easing;
&.ng-hide-add,&.ng-hide-remove{
display: block !important;
#{$property}: $min-val;
}
&.ng-hide-remove.ng-hide-remove-active{
#{$property}: $max-val;
@rcastillo
rcastillo / gist:2632281
Created May 8, 2012 03:17
socket.io Jasmine helpers for creating test socket.io server and client
var _ = require('underscore'),
SocketIOClient = require('socket.io-client'),
liveSocket = require('../lib/live-socket');
exports.setupClient = function(opts) {
return function() {
opts = opts || {};
_.defaults(opts, {
url: 'http://localhost:8000',
options: {
@prozacgod
prozacgod / synchro.js
Created June 9, 2011 20:43
node.js synchronize multiple actions
/*
A simple and elegant function to synchronize multiple functions that expect callback as their last parameter.
example:
sync(func1, [parms], func2, func3, func4, [parms], callback);
Public domain!!
please leave me a comment if you like it!
*/
@curtiswilkinson
curtiswilkinson / interface.js
Last active January 11, 2018 19:44
Interface using pick
interface Task {
id: string,
name: string,
assignee: string,
contacts: any[], //for brevity
associatedJob: string,
submissionDate: string,
allocatedTime: number,
expectedCompletion: string,
invoiceNumber: string,
@leoasis
leoasis / marionette_rivets.js
Last active March 7, 2019 16:00
React vs Marionette + Rivets
var List = Backbone.Marionette.CollectionView.extend({
itemView: Item,
tagName: 'ul'
});
var Item = Backbone.Marionette.ItemView.extend({
tagName: 'li',
template: function(data) {
return '<span rv-text="model.name"></span><p rv-text="model.description"><p>';
},
@sanderhahn
sanderhahn / gulpfile.js
Last active September 11, 2019 14:45
Minify and templateCache your Angular Templates using Gulp
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var templates = require('gulp-angular-templatecache');
var minifyHTML = require('gulp-minify-html');
// Minify and templateCache your Angular Templates
// Add a 'templates' module dependency to your app:
// var app = angular.module('appname', [ ... , 'templates']);
@balupton
balupton / ajaxify-html4.js
Created March 7, 2011 04:58
Ajaxify a Website using the HTML4 HashChange Functionality
(function(window,undefined){
// Prepare our Variables
var
document = window.document,
$ = window.jQuery;
// Wait for Document
$(window).bind(function(){
// Prepare Variables
@jareware
jareware / package-json-engines.md
Last active October 30, 2020 18:36
Enforcing the engines property of package.json

Document your target environment with:

"engines": {
  "npm": ">=3.3.12 <4",
  "node": ">=5.5.0 <6"
},

Then install this:

"devDependencies": {

@tkihira
tkihira / gist:2367067
Created April 12, 2012 13:02
rmdir recursively in node.js
var fs = require("fs");
var path = require("path");
var rmdir = function(dir) {
var list = fs.readdirSync(dir);
for(var i = 0; i < list.length; i++) {
var filename = path.join(dir, list[i]);
var stat = fs.statSync(filename);
if(filename == "." || filename == "..") {
@desandro
desandro / bower-logo.md
Last active December 30, 2021 23:11
Bower logo

In addition to awesome docs #228, Bower deserves a proper logo. See below for sketches. I'm curious if you think any of these are worth me putting more effort into.


Take a look at Yeoman right now.

Screen Shot 2013-02-19 at 4 43 10 PM

The other two entities have awesome logos. Bower's got to represent.