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
// Node.js | |
data.find('id', function(err, response){ | |
var one = response[0]; | |
var many = response; | |
var error = err; | |
}); | |
// EventEmitter |
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
mixin field(type, name, label) | |
-var form_model = locals.form_model || {} | |
if type === 'hidden' | |
input(name=name, type=type, value=form_model[name]) | |
else | |
.control-group(class=locals.fieldClass(name, locals.errors)) | |
label.control-label(for='id_' + name) #{label} |
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
- inject: (args)-> | |
| | |
| { verifyBrowserId } = args if args.verifyBrowserId | |
| { users } = args if args.users | |
- checkRedirectUrl: (req, res, next)-> | |
| | |
| if req.query.redirect_url | |
| |
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
module.exports = { | |
bark: function(){ | |
console.log('woof'); | |
}, | |
speak: function(){ |
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
{ | |
size: 100, | |
query: { | |
query_string: { | |
fields: ['name', 'author', 'tags'], | |
query: q | |
} | |
} | |
} |
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 index = { | |
package: { | |
properties: { | |
name: { type: 'string', store: 'no' }, | |
tags: { type: 'string', store: 'no' }, | |
author: { type: 'string', store: 'no' }, | |
doc: { type: 'object', store: 'yes', index: 'no' } | |
} | |
} | |
}; |
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
$( function(){ | |
var form = $('<form>'); | |
var iframe = $('<iframe name="upload_iframe">'); | |
var file_upload = $('.file-upload'); | |
// Form | |
form.attr("target", "upload_iframe"); | |
form.attr("action", '/upload'); |
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
balance: | |
map: (doc)-> | |
if doc.type is 'transaction' | |
emit( doc.relatedId, doc.amount ) | |
reduce: (keys, values, rereduce)-> | |
total = 0.0 |
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 route can be used to complete the tutorial at: | |
// https://developer.mozilla.org/en/BrowserID/Quick_Setup | |
app.post('/api/login', function( req, res, next ) { | |
var options = { | |
host: 'browserid.org', | |
path: '/verify', | |
method: 'POST' | |
}; |
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
#!upstart | |
description "service.krafters.be" | |
author "Geert" | |
start on (local-filesystems and net-device-up IFACE=eth0) | |
stop on shutdown | |
#respawn # restart when job dies |