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
js> isNaN(null); | |
false | |
js> null > -1; | |
true | |
js> null < 1; | |
true | |
js> null > 0; | |
false | |
js> null < 0; | |
false |
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 Response = require('ringo/webapp/response').Response | |
, Request = require('ringo/webapp/request').Request | |
, defer = require('ringo/promise').defer | |
, jsdeps = require('../jsdeps/index') | |
, setTimeout = require('ringo/scheduler').setTimeout; | |
exports.packages = function(req) { | |
var response = defer() | |
, params | |
, prereqs |
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
// $('myDiv').bind('click', $.proxy(this.myFunc, this)); |
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 foo = {a: function () { console.log(this.b); }, b: true}; | |
> foo.b; | |
true | |
> foo.a; | |
[Function] | |
> foo.a(); | |
true | |
> var bar = foo.a; | |
> foo; | |
{ a: [Function], b: true } |
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 spawn = require('child_process').spawn; | |
desc('Do thing 1'); | |
task('thing1', [], function () { | |
var cmds = ['node -e "console.log(\'--> Thing 1... Executing\')"']; | |
console.log('--> Thing 1... Starting'); | |
jake.exec(cmds, function () { | |
var echo = spawn('echo', |
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
// User, hasOne Profile | |
var u = User.create({ | |
login: 'asdf' | |
, password: 'zerb' | |
, confirmPassword: 'zerb' | |
}); | |
// Owner has to be saved to add an association | |
u.save(function (err, data) { | |
if (err) { | |
throw err; |
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
" JS syntax for Jakefiles | |
au BufRead,BufNewFile Jakefile set filetype=javascript | |
" JS syntax for .jake files | |
au BufRead,BufNewFile *.jake set filetype=javascript |
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 Item = function () { | |
this.defineProperties({ | |
name: {type: 'string'} | |
}); | |
this.findByName = function (name, callback) { | |
geddy.model.Item.all({name: name}, callback); | |
} | |
} |
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
---- (somewhere in the page head) ---- | |
<script type="text/javascript"> | |
yam.connect.loginButton('#yammer-login', function (resp) { | |
if (resp.authResponse) { | |
document.getElementById('yammer-login').innerHTML = 'Welcome to Yammer!'; | |
} | |
}); |
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
git clone [email protected]:mde/geddy.git | |
cd geddy | |
checkout -t origin/passport-integration | |
mkdir node_modules | |
npm install | |
cd .. | |
git clone [email protected]:mde/geddy-passport.git | |
cd geddy-passport | |
npm install | |
../geddy/bin/cli.js |