I hereby claim:
- I am davidbanham on github.
- I am davidbanham (https://keybase.io/davidbanham) on keybase.
- I have a public key whose fingerprint is 8428 8E68 6C9A DC59 EC48 CBFA 13F6 3D81 CDB8 59E6
To claim this, I am signing this object:
A common way to write your test script in a package.json is: | |
"scripts": { | |
"test": "mocha" | |
}, | |
But that expects the user to have mocha (or karma, etc) installed globally. A more portable way to do it is call the locally installed runner directly: | |
"scripts": { | |
"test": "./node_modules/.bin/mocha" |
I hereby claim:
To claim this, I am signing this object:
class TokenAdder | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, body = @app.call(env) | |
response = Rack::Response.new body, status, headers |
// Include the CoffeeScript interpreter so that .coffee files will work | |
var coffee = require('coffee-script'); | |
// Explicitly register the compiler if required. This became necessary in CS 1.7 | |
if (typeof coffee.register !== 'undefined') coffee.register(); | |
// Include our application file | |
var app = require(process.argv[2] || './app.coffee'); |
#Sometimes I want to munge data that I've pulled from a backend with Angular. The Promises implementation augments the object with it's own $properties and I don't want to munge those. | |
app = angular.module 'GetOffMyLawn' | |
app.controller 'DangKids', ($scope, $resource) -> | |
Wat = $resource '/wat' | |
Wat.get {}, (data) -> | |
#data is something like { foo: {something: 1, somethingElse: 2} } |
. | |
├── bin | |
│ └── gotour | |
├── pkg | |
│ └── darwin_amd64 | |
│ └── code.google.com | |
└── src | |
├── code.google.com | |
└── github.com | |
└── davidbanham |
var http = require('http'); | |
opts = { | |
domain: 'google.com' | |
} | |
http.get(opts, function(res) { | |
response = '' | |
res.on('data', function(data) { | |
response += data.toString() | |
} | |
res.on('end', function() { |
var upnode = require('../'); | |
var dnode = require('dnode'); | |
var test = require('tap').test; | |
var net = require('net'); | |
test('simple', function (t) { | |
t.plan(1); | |
var port = Math.floor(Math.random() * 5e4 + 1e4); | |
var up = upnode.connect(port); |
// Design Doc: | |
{ | |
"_id": "_design/things", | |
"_rev": "3-c05af422e754a6734d1843e309fa1135", | |
"language": "javascript", | |
"views": { | |
"filter": { | |
"map": "function(doc) { emit([doc.country, doc.city], doc); }" | |
} |
// Include the CoffeeScript interpreter so that .coffee files will work | |
var coffee = require('coffee-script'); | |
// Include our application file | |
var app = require('./app.coffee'); |