This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var Deferred = require("JQDeferred"); | |
var _ = require("lodash"); | |
function when() { | |
var arrayOfPromises = _.isArray(arguments[0]) ? arguments[0] : arguments; | |
var dfds = _.map(arrayOfPromises,function(promise){ | |
var dfd = new Deferred(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ko.rockout.fromJS = function fromJS(target) { | |
target = ko.toJS(target); | |
if (_.isPlainObject(target)) { | |
var result = {}; | |
_.each(target, function (item, key) { | |
if (!_.isFunction(item)) { | |
result[key] = fromJS(item); | |
} | |
}); | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(_){ | |
function makePath(path){ | |
return path.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'); | |
}; | |
_.mixin({ | |
get: function (obj, path, defaultValue) { | |
if (_.isString(path)) { | |
path = split(path); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get(obj, path, defaultValue) { | |
if (typeof path === "string") { | |
path = path.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.'); | |
} | |
// end of the line (found nothing) | |
if (obj === undefined) { | |
return defaultValue; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF NOT EXISTS(SELECT * FROM sys.columns WHERE Name = N'columnName' AND Object_ID = Object_ID(N'tableName')) | |
BEGIN | |
-- Column Exists | |
END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require("react"); | |
var ReactDOM = require("react-dom"); | |
var _ = require('lodash'); | |
/* | |
This component is meant to facilitate side to side slide transitions. | |
It's props are: | |
goToIndex : the index of the slide to show, REQUIRED | |
duration : the duration of the sliding, REQUIRED | |
easing : the css easing type, also known as the transition-timing-fuction, DEFAULTS to 'ease-in-out' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var r=[],i=1;for(;i<101;i++)r.push(((i%3?'':'fizz')+((i%5)?'':'buzz'))||i);console.log(r); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var ReactDOM = require('react-dom'); | |
var document = global.document; | |
module.exports = React.createClass({ | |
componentDidMount : function() { | |
this.node = document.getElementById('component-modal-overlay'); | |
if(!this.node){ | |
this.node = document.createElement("div"); | |
this.node.id = 'component-modal-overlay' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtualenv --no-site-packages ./ | |
. bin/activate | |
pip install nodeenv | |
nodeenv --node=X.X.X -p | |
npm install -g npm | |
git clone [email protected]:your-user/ua-b2c.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace ThinkingSites | |
{ | |
public class Injection | |
{ | |
private static Dictionary<Type, Func<object>> Registry = new Dictionary<Type, Func<object>>(); |