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() { | |
function hOPExtend(obj) { | |
var args = Array.prototype.slice.call(arguments, 1) | |
for (var i = 0; i < args.length; i++) { | |
source = args[i] | |
for (var prop in source) if (source.hasOwnProperty(prop)) { | |
obj[prop] = source[prop]; | |
} | |
} |
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 newrelic = require('newrelic') | |
var http = require('http') | |
function handleRequest(req, res) { | |
console.log('Handling request') | |
// Swallows the exception on the next line. | |
// Should throw a runtime error instead since DiesHere is undefined. | |
var x = DiesHere | |
res.end() | |
} |
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 obj = { fn:function() { return 'Wooo!' } } | |
JSON.stringify(obj) // '{}' | |
obj.fn.toJSON = function() { return this() } | |
JSON.stringify(obj) // '{"fn":"Wooo!"}' |
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
describe('TaskRunner', function () { | |
var scope | |
var TR | |
var $q | |
var success | |
var error | |
function MockTasks() { | |
this.tasks = [] | |
this.dfds = [] |
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
{ | |
init: function(elevators, floors) { | |
var pickup = {up:[], down:[]} | |
var topFloor = floors.length - 1 | |
var bottomFloor = 0 | |
console.log(floors[0]) | |
// setup floors | |
floors.forEach(function(floor, i) { | |
pickup.up[i] = false | |
pickup.down[i] = false |
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
// dimensions Cherry MX connector | |
var c_corr = 0.4 // tolerance | |
var c_horiz = 1.1 // horizontal bar width | |
var c_vert = 1.0 // vertical bar width | |
var c_dia = 4 // cross width | |
var c_depth = 7 // connector depth | |
var c_space = 7 // height of hollow inside | |
var c_inset = 0.75 // distance connector start to keycap base | |
// stuff |
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
/* | |
Loads and registers routes automatically. | |
USAGE | |
{ | |
register: require('../app/plugins/route-loader'), | |
options: { | |
pattern: 'app/routes/*.js' | |
} |
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
{ | |
plugin: { | |
register: './app/plugins/s3-upload-token', | |
options: { | |
accessKey: 'YOURACCESSKEY', | |
secretKey: 'YOURSECRETKEY', | |
photoBucket: 'YOURBUCKET', | |
s3Policy: { | |
expiration: 10 * 60 * 1000, // 10 min | |
conditions: [ |
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
{ | |
"nodes": [ | |
{ "id": 1, "x": 40, "y": 40 }, | |
{ "id": 2, "x": 80, "y": 40 }, | |
{ "id": 3, "x": 120, "y": 40 }, | |
{ "id": 4, "x": 160, "y": 40 }, | |
{ "id": 5, "x": 200, "y": 40 }, | |
{ "id": 6, "x": 240, "y": 40 }, | |
{ "id": 7, "x": 280, "y": 40 }, | |
{ "id": 8, "x": 320, "y": 40 }, |
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
// +build ignore | |
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"os" | |
"path/filepath" | |
"strconv" |
OlderNewer