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
// amap -- asynchronous map | |
// | |
// Maps fn over list and passes the result to callback. For example, | |
// | |
// function loadEntries(folder, callback) { | |
// fs.readdir(folder, function(err, files) { | |
// if (err) throw err; | |
// amap(files, callback, function(name, index, next) { | |
// load(path.join(folder, name), next); | |
// }); |
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 assert = require('assert'), | |
sys = require('sys'), | |
pwd = require('password'), | |
vows = require('vows'); | |
vows.describe('Password').addBatch({ | |
'The default method': method(pwd), | |
'The bcrypt method': method(pwd.bcrypt), | |
'The sha512 method': method(pwd.sha512) | |
}).export(module); |
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
// Create an absolute jQuery selector for a DOM element. | |
// | |
// + el - Element to select. | |
// | |
// Returns String selector. | |
function makeSelector(el) { | |
var tag, index, stack = []; | |
for (; el.parentNode; el = el.parentNode) { | |
tag = el.tagName; |
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
#!/usr/bin/env python | |
## Download some grab.by images into the current directory. | |
## Requires curl command-line utility. | |
## | |
## The bounds should be given in base62 (e.g. in the range 0 - ZZZZ). | |
## | |
## Example: | |
## | |
## mkdir /tmp/grab |
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
gambit-server/web-server | |
snap-hello-server/bin | |
snap-hello-server/dist/ |
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
// An example of how to use stack introspection to determine the | |
// filename of a calling script. | |
// | |
// node stack1.js | |
// | |
function blah() { | |
require('./stack2'); | |
} |
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
.packages | |
*.pyc |
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
import json | |
from datetime import datetime | |
class Foo(object): | |
def __init__(self, when): | |
self.when = when | |
def __json__(self): | |
return self.__dict__ |
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
// In Express 1.0.8, the `res.app` and `req.app` properties aren't restored when | |
// outerNext() is called by nested server middleware. | |
// | |
// Run this script, then try to visit something handled by the `notFound()` middleware | |
// (e.g. `http://localhost:3000/mumble`. An assertion error is raised because `res.app` | |
// is equal to the `middleware()` instead of `app`. | |
var Assert = require('assert'), | |
Express = require('express'), | |
app = Express.createServer(); |
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_modules |