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
forever = require 'forever' | |
child = forever.start ['coffee', 'website.coffee'] | |
child = forever.start ['coffee', 'feeds.coffee'] | |
child = forever.start ['coffee', 'jobs.coffee'] |
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
false && ( function(){ console.log('NONONO'); } )(); | |
true && ( function(){ console.log('YESYESYES'); } )(); |
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
//At first I was doing this a lot. But having to repeat the if statement bothered me a lot. | |
function(req, res, next){ | |
emit('get my document', function(data){ | |
if( data.length === 0 ){ | |
next( new Error(404) ); | |
} else { | |
res.render('user', { user: data }); | |
} |
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
rules = [ | |
rule 'username', ( -> @req.body.username ), somevalidator | |
rule 'password', ( -> @req.body.password ), somevalidator | |
] |
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
//layout.jade | |
!!! 5 | |
html | |
head | |
title test | |
body | |
block content | |
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
//layout.jade | |
!!! 5 | |
html | |
head | |
title test | |
body | |
block content | |
//admin.jade |
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
//layout.jade | |
!!! 5 | |
html | |
head | |
title test | |
body | |
block content | |
//admin.jade |
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
from django.core.management import setup_environ | |
import settings | |
setup_environ(settings) | |
from django.db import connection | |
from apps.books.models import Book | |
books = Book.objects.raw( """ | |
select * |
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
class Project | |
constructor : -> | |
@data = | |
id : ko.observable() | |
name : ko.observable() | |
client : ko.observable() | |
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
class Observer | |
constructor : (data, fn, ignore=[])-> | |
@listen = false | |
result = ko.dependentObservable -> | |
for key, val of data | |
if ko.isObservable(val) and key not in ignore | |
val() |