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
/* | |
* REST endpoint: /projects | |
*/ | |
var projects = [ | |
{ | |
"id": 2, | |
"name": "Project 1", | |
"members": [ | |
{"id": 1, "name": "Tom", "phone": "555-5555"}, | |
{"id": 2, "name": "Sue", "phone": "555-5555"} |
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 user = new User({ | |
id: 1, | |
username: "bob", | |
address: { | |
id: 1, | |
street: "232 SW Main" | |
city: "", | |
state: "", | |
zip: "" | |
} |
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 child = new Backbone.Model({name: "child"}); | |
var parent = new Backbone.Model({name: "parent", child: child}); | |
var json = parent.toJson() | |
This should return: | |
{ | |
name: "parent", | |
child: { | |
name: "child" | |
} |
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 FindUserCollection = Backbone.Collection.extend({ | |
model: User, | |
baseUrl: "/api/v2/users", | |
url: function() { | |
return this.baseUrl + '?' + $.param({ | |
search: this.search, | |
limit: this.limit | |
}); | |
} | |
search: null, |
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
tauren@godzilla:~$ ssh -vv [email protected] | |
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007 | |
debug1: Reading configuration data /home/tauren/.ssh/config | |
debug1: Applying options for * | |
debug1: Reading configuration data /etc/ssh/ssh_config | |
debug1: Applying options for * | |
debug2: ssh_connect: needpriv 0 | |
debug1: Connecting to schedules.somewhere.com [192.168.192.126] port 22. | |
debug1: Connection established. |
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
scree[K[K[K[K[Kmake clean | |
python tools/waf-light clean | |
DEST_OS: linux | |
DEST_CPU: x64 | |
Parallel Jobs: 8 |
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
tauren@godzilla:/projects/git/node$ ./configure --prefix=$HOME/local/node | |
Checking for program g++ or c++ : /usr/bin/g++ | |
Checking for program cpp : /usr/bin/cpp | |
Checking for program ar : /usr/bin/ar | |
Checking for program ranlib : /usr/bin/ranlib | |
Checking for g++ : ok | |
Checking for program gcc or cc : /usr/bin/gcc | |
Checking for gcc : ok | |
Checking for library dl : yes | |
Checking for openssl : yes |
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
app.get '/realms', (req,res) -> | |
name = req.query.jsonp || 'jsonp' | |
res.contentType 'application/x-javascript' | |
fs.readFile __dirname + '/../../data/realms.json', (err,data) -> | |
if err | |
throw error | |
res.send name + '(' + data + ');' | |
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
# Static site | |
app.get '/site/*:name', (req,res) -> | |
console.log 'Getting file ' + req.params.name | |
res.sendfile __dirname + '/public/' + req.params.name |
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
// usage: log('inside coolFunc', this, arguments); | |
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if(this.console) { | |
arguments.callee = arguments.callee.caller; | |
console.log( Array.prototype.slice.call(arguments) ); | |
} | |
}; |
OlderNewer