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 Ribcage = require('ribcage-view') | |
, OuterView | |
, InnerView | |
, myView; | |
InnerView = Ribcage.extend({ | |
events: { | |
'click a': 'handleClick' | |
} | |
, template: function () { |
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
{ | |
"browser": true, | |
"node": true, | |
"esnext": true, | |
"globals": {}, | |
"globalstrict": true, | |
"laxcomma": true, | |
"strict": false, | |
"quotmark": true, | |
"smarttabs": 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
, getComments: function () { | |
if(!this.comments) | |
throw new Error('You need to loadComments before you can get comments'); | |
return this.comments.map(function (comment) { | |
var obj = comment.toJSON(); | |
obj.relativeDate = relative(obj.updated); | |
return obj; | |
}); |
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 Backbone = require('backbone') | |
, $ = require('jquery')(window) | |
, View | |
, myView | |
, testModel; | |
Backbone.$ = $; | |
testModel = new Backbone.Model(); |
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 MyView = Ribcage.View.extend({ | |
afterInit: function (opts) { | |
this.action = opts.action; | |
} | |
, beforeRender: function () { | |
this.button = new ButtonView({ | |
action: this.action | |
}); | |
} | |
, afterRender: function () { |
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
func main() { | |
runloop := func() { | |
// Recovers from panics | |
defer func() { | |
if r := recover(); r != nil { | |
runloop() // why doesn't this compile?? "undefined: runloop" | |
} | |
}() | |
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
// 1 (closures/asyncrony) | |
function sleepsort (input) { | |
for(var i=0; i<input.length; i++) { | |
setTimeout(function () { | |
console.log(i); | |
}, i * 1000); | |
console.log('iterated'); | |
} | |
}; |
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 http = require('http') | |
, fs = require('fs'); | |
http.createServer(function(request, response){ | |
response.writeHead(200, {'Content-Type': 'text/html' }); | |
fs.createReadStream('index.html').pipe(response); | |
}).listen(8080); |
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
####################################### | |
Finding jobs... | |
61 jobs found: | |
D0-D13012-MO | |
A thing some-thing | |
My new site 00-new | |
A test job FAKE-000 | |
Office fakejob# | |
My apartment 00-house | |
D0-A13806-00 |