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
# enable symlinks | |
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] |
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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="mocha.css" /> | |
<!--<script src="../libs/jquery/jquery.min.js"></script>--> | |
<!--<script src="../libs/moment/min/moment.min.js"></script>--> | |
<!--<script src="../libs/underscore/underscore-min.js"></script>--> | |
<!--<script src="../libs/backbone/backbone-min.js"></script>--> | |
<!--<script src="../libs/easeljs-0.5.0.min.js"></script>--> | |
</head> |
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(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');if(!mod.exports){mod.exports={};mod.call(mod.exports,mod,mod.exports,require.relative(path))}return mod.exports}require.modules={};require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig};require.register=function(path,fn){require.modules[path]=fn};require.relative=function(parent){return function(p){if("."!=p.charAt(0))return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i<segs.length;i++){var seg=segs[i];if(".."==seg)path.pop();else if("."!=seg)path.push(seg)}return require(path.join("/"))}};require.register("browser/debug.js",function(module,exports,require){module.exports=function(type){return function(){}}});require.register("browser/diff.js",function(module,exports,require){var JsDiff=function(){function clonePath(path){return{newPos:path. |
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
describe('Array', function(){ | |
describe('#indexOf()', function(){ | |
it('should return -1 when the value is not present', function(){ | |
assert.equal(-1, [1,2,3].indexOf(5)); | |
assert.equal(-1, [1,2,3].indexOf(0)); | |
}); | |
}); | |
}); |
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
// this is used to work in Node.js | |
// if you want to use it inside the browser, replace the map function to ensure older browser support. | |
// DEPENDENCIES: underscore! | |
function omitFields (model, hidden_fields) { | |
var hider_code = 'return _.omit(model'; | |
hidden_fields.map(function (hider) { | |
hider_code += ', \''+hider+'\''; | |
}); | |
hider_code += ');'; |
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
// borrowd from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html | |
function pnpoly (points, test) { | |
var i, j, c = false; | |
for( i = 0, j = points.length-1; i < points.length; j = i++ ) { | |
if( ( ( points[i].y > test.y ) != ( points[j].y > test.y ) ) && | |
( test.x < ( points[j].x - points[i].x ) * ( test.y - points[i].y ) / ( points[j].y - points[i].y ) + points[i].x ) ) { | |
c = !c; | |
} | |
} | |
return c; |
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
{ | |
"name" : basename.replace(/^node-/, ''), | |
"version" : "0.0.0", | |
"description" : prompt('description, what are you working on?', ''), | |
"main" : prompt('entry point', 'index.js'), | |
"bin" : function (cb) { | |
var path = require('path'); | |
var fs = require('fs'); | |
var exists = fs.exists || path.exists; | |
exists('bin/cmd.js', function (ex) { |
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
{ | |
"do you want to use browserify? (Y/n) ": { | |
"dependencies": { | |
"browserify": "~2.35.2", | |
"uglifyjs": "~2.3.6" | |
}, | |
"scripts": { | |
"build-js": "browserify browser/main.js | uglifyjs -mc > static/bundle.js" | |
}, | |
"default": true |
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
{ | |
"name": "<NAME>", | |
"version": "<VERSION>", | |
"description": "<DESCRIPTION>", | |
"main": "<START>", | |
"bin": {}, | |
"directories": { | |
"example": "example", | |
"test": "test" | |
}, |
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
// User | |
// ==== | |
var UserSchema = mongoose.Schema({ | |
username: String, | |
email: String, | |
salt: String, | |
hashed_password: String, | |
orgas: [{type: mongoose.Schema.ObjectId, ref: 'Organization'}] | |
}); |
OlderNewer