This file contains 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'), | |
assert = require('assert') | |
mongoose.connect('localhost/mydb'); | |
var Schema = mongoose.Schema; | |
var ContainerSchema = new Schema({ | |
name: String, | |
}) |
This file contains 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() { | |
if(navigator.appVersion.indexOf('MSIE 8') > 0) { | |
var _slice = Array.prototype.slice; | |
Array.prototype.slice = function() { | |
if(this instanceof Array) { | |
return _slice.apply(this, arguments); | |
} else { | |
var result = []; | |
var start = (arguments.length >= 1) ? arguments[0] : 0; | |
var end = (arguments.length >= 2) ? arguments[1] : this.length; |
This file contains 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
// mongoose v3.6.18 | |
// | |
var mongoose = require('mongoose'); | |
mongoose.connect('localhost/mydb'); | |
var Schema = mongoose.Schema; | |
var MasterSchema = new Schema({ | |
name: String, | |
}); |
This file contains 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 above = function(limit){ | |
return function(value){ | |
return value > limit; | |
}; | |
}; | |
var isAbove10 = above(10); | |
console.log(isAbove10(5)); // false | |
console.log(isAbove10(8)); // false |
This file contains 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
// based off of https://gist.github.com/creationix/5544019 | |
// these could probably be condensed more, but I'm just doing this | |
// quickly | |
function call(func) { | |
var args = Array.prototype.slice.call(arguments, 1); | |
return function(callback) { | |
args.push(callback); |
This file contains 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
<!DOCTYPE html> | |
<html{% if(o.htmlWebpackPlugin.files.manifest) { %} manifest="{%= o.htmlWebpackPlugin.files.manifest %}"{% } %}> | |
<head> | |
<meta charset="UTF-8"> | |
<title>{%=o.htmlWebpackPlugin.options.title || 'Webpack App'%}</title> | |
{% if (o.htmlWebpackPlugin.files.favicon) { %} | |
<link rel="shortcut icon" href="{%=o.htmlWebpackPlugin.files.favicon%}"> | |
{% } %} | |
{% for (var css in o.htmlWebpackPlugin.files.css) { %} | |
<link href="{%=o.htmlWebpackPlugin.files.css[css] %}" rel="stylesheet"> |
This file contains 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
// devDependencies in package.json: | |
"require-reload": "0.2.2", | |
"react-transform-hmr-no-accept": "1.0.1", // not published, get it here: https://github.com/brandonbloom/react-transform-hmr | |
// in babelrc: | |
"env": { | |
"development": { | |
"plugins": [ |
This file contains 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
// a sort-of-polyfill for `currentThis` as proposed in: https://gist.github.com/getify/5253319 | |
function lookupFn(oThis,fn) { | |
var ptr = oThis, i, keys; | |
while (ptr) { | |
keys = Object.keys(ptr); | |
for (i=0; i<keys.length; i++) { | |
if (ptr[keys[i]] === fn) { | |
return ptr; | |
} | |
} |
This file contains 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
. | |
├── node_modules | |
│ ├── 00963d697b2adf0c185c4e04e73174ba9b288eb2 | |
│ │ ├── node_modules | |
│ │ │ └── xml-escape -> ../../00963d697b2adf0c185c4e04e73174ba9b288eb2/package | |
│ │ └── package | |
│ │ ├── LICENSE | |
│ │ ├── README.md | |
│ │ ├── index.js | |
│ │ ├── package.json |