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
Definition of “DigitalLocation”: | |
Instead of tracking your physical location, like GeoLocation does, DigitalLocation tracks your “Location” on the Web. | |
So, in short, DigitalLocation consists of a timestamp, a domain, a path, and any other meta-data that the consumer or | |
provider would like to attach. | |
Example DigitalLocation in a JSON format: | |
{ | |
domain: “http://docs.google.com”, | |
path: “/a/techwraith.com/”, |
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 pFilters = []; | |
function togglePotatoes(pType) { | |
if (pFilters.indexOf(pType) > -1) { | |
pFilters.splice(pFilters.indexOf(pType),1); | |
} else { | |
pFilters.push(pType); | |
} | |
console.log(pFilters.join(",")); | |
$(pFilters.join(",")).hide('fast'); |
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
app.js | |
var thing = require('./foo'); | |
thing.foo(); // "Hello World" | |
foo.js | |
exports.foo = function(){console.log("Hello World"); |
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 kue = require('kue'); | |
var jobs = kue.createQueue(); | |
var i = 1; | |
var jobInterval = setInterval(function(){ | |
console.log("creating job " + i + ".") | |
jobs.create('test', {title:"This is a test", thing:"another thing.", id: i}); | |
i++; | |
},2000); | |
setTimeout(function(){ | |
clearInterval(jobInterval); |
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 name = 'test' | |
var foo = 'foo'; | |
var bar = 'bar'; | |
var func = function(arg1, arg2) { | |
console.log(arg1, arg2, this.name); | |
}; | |
var obj = { | |
name: 'something new' |
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
$ npm install -g express | |
$ express /tmp/foo -c "stylus" && cd /tmp/foo | |
$ npm install -d |
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.toObj = function () { | |
var obj = {}; | |
for (var p in this) { | |
// For some reason if this has more than one if statement | |
// or if the if is checking more than one thing via "||" it | |
// completely ignores it and assumes it's true | |
if ( (typeof this[p] != 'function') && p != 'adapter' && p != 'type') { | |
obj[p] = this[p]; | |
} |
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 Item = function () { | |
this.defineProperties({ | |
name: {type: 'string'} | |
}); | |
this.findByName = function (name, callback) { | |
geddy.model.Item.all({name: name}, 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
for (var i in ModelDefinition) { | |
if (ModelDefinition.hasOwnProperty(i)) { | |
defined[i] = ModelDefinition[i]; | |
} | |
} |
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
// Send a static file path | |
sendStaticFile = function (p) { | |
staticResp = new response.Response(resp); | |
// May be a path to a directory, with or without a trailing | |
// slash -- any trailing slash has already been stripped by | |
// this point | |
if (fs.statSync(p).isDirectory()) { | |
// TODO: Make the name of any index file configurable | |
<<<<<<< HEAD |
OlderNewer