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
[ | |
{"id": "b001", "name": "Acme Broadcasting", "published": true, "type": "broadcaster", "parent": null}, | |
{"id": "m001", "name": "Boston", "published": false, "type": "market", "parent": "b001"}, | |
{"id": "s001", "name": "WQXZ", "published": false, "type": "station", "parent": "m001"}, | |
{"id": "s002", "name": "WPYT", "published": true, "type": "station", "parent": "m001"}, | |
{"id": "m002", "name": "New Jersey", "published": true, "type": "market", "parent": "b001"}, | |
{"id": "s003", "name": "WPYT", "published": false, "type": "station", "parent": "m002"}, | |
{"id": "b002", "name": "American Broadcasters", "published": false, "type": "broadcaster", "parent": null}, | |
{"id": "m003", "name": "Atlanta", "published": false, "type": "market", "parent": "b002"}, | |
{"id": "s004", "name": "WXYZ", "published": true, "type": "station", "parent": "m003"}, |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
) |
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
package main | |
import ( | |
"bytes" | |
"compress/zlib" | |
"crypto/sha1" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"path" |
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
Show hidden characters
{ | |
"bitwise": true, | |
"camelcase": true, | |
"eqeqeq": true, | |
"forin": true, | |
"immed": true, | |
"latedef": "nofunc", | |
"newcap": true, | |
"noarg": true, | |
"noempty": true, |
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 get(url) { | |
// Return a new promise. | |
return new Promise(function(resolve, reject) { | |
// Do the usual XHR stuff | |
var req = new XMLHttpRequest(); | |
req.open('GET', url); | |
req.onload = function() { | |
// This is called even on 404 etc | |
// so check the status |
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
# For MacOS: | |
.DS_Store | |
# For TextMate | |
*.tmproj | |
tmtags | |
.tm_properties | |
# For emacs: | |
*~ |
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
> winston-mongodb@0.4.3 test /Users/leroy/repos/git/winston-mongodb | |
> vows test/*-test.js --spec | |
♢ winston-mongodb | |
An instance of the MongoDB Transport when passed valid options | |
✓ should have the proper methods defined | |
An instance of the MongoDB Transport the log() method when passed primitive metadata |
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
'use strict'; | |
var assert = require('assert'); | |
var fs = require('fs'); | |
var crypto = require('crypto'); | |
var stream = require('stream'); | |
var littleSha = crypto.createHash('sha256'); | |
var message = new Buffer('this is a small message'); |
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
'use strict'; | |
var crypto = require('crypto'); | |
var stream = require('stream'); | |
function radixId (radix, callback) { | |
crypto.randomBytes(4, function (err, buf) { | |
if (err) { return callback(err); } | |
try { |
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
'use strict'; | |
var hashpress = require('./hashpress'); | |
var obj = { | |
username: 'foo', | |
likes: ['cats', 'candy'], | |
quote: "I don't always program JavaScript...but when I do, I use Node.js" | |
}; |