Skip to content

Instantly share code, notes, and snippets.

View dhm116's full-sized avatar

Doug McCall dhm116

  • State College, PA
View GitHub Profile
const routes = [
{
method: 'GET',
path: '/locations',
handler: async (request, h) => {
const db = server.app.db;
const locationCollection = db.collection('locations');
// query all locations
@dhm116
dhm116 / Dockerfile
Created June 24, 2013 20:01
Sample Dockerfile resulting in `lookup failed` errors due to performing `make install` on the CDF library
from ubuntu
maintainer dhm116@arl.psu.edu
#run apt-get install -y python python-setuptools #python-numpy python-scipy python-pandas
#run python easy_install pip logbook gevent zerorpc
RUN apt-get -y update
RUN apt-get install -y -q software-properties-common
RUN apt-get install -y -q python-software-properties
RUN add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
@dhm116
dhm116 / Makefile
Created May 31, 2013 17:55
Dagre.js Makefile for Windows
SHELL=C:/Windows/System32/cmd.exe
NODE?=node
NPM?=npm
PEGJS?=node node_modules/pegjs/bin/pegjs
MOCHA?=node node_modules/mocha/bin/mocha
MOCHA_OPTS?=--recursive
JS_COMPILER=node node_modules/uglify-js/bin/uglifyjs
JS_COMPILER_OPTS?=--no-seqs
all: package.json dagre.js dagre.min.js
@dhm116
dhm116 / embed.ly.solution.py
Created February 10, 2012 20:29
Python-based solvers for the embed.ly challenge
from __future__ import division
import urllib2
from BeautifulSoup import BeautifulSoup
import numpy as np
def notN(num):
result = num
while num > 1:
result = result * (num - 1)
num -= 1
@dhm116
dhm116 / ie.shims.js
Created February 10, 2012 15:14
IE7/8 Javascript method shims
'use strict';
// Add ECMA262-5 method binding if not supported natively
//
if (!('bind' in Function.prototype)) {
Function.prototype.bind= function(owner) {
var that= this;
if (arguments.length<=1) {
return function() {
return that.apply(owner, arguments);
@dhm116
dhm116 / gist:1565276
Created January 5, 2012 13:33
node-git repo instance output
{ ArrayBuffer: [Function: ArrayBuffer],
Int8Array: { [Function] BYTES_PER_ELEMENT: 1 },
Uint8Array: { [Function] BYTES_PER_ELEMENT: 1 },
Int16Array: { [Function] BYTES_PER_ELEMENT: 2 },
Uint16Array: { [Function] BYTES_PER_ELEMENT: 2 },
Int32Array: { [Function] BYTES_PER_ELEMENT: 4 },
Uint32Array: { [Function] BYTES_PER_ELEMENT: 4 },
Float32Array: { [Function] BYTES_PER_ELEMENT: 4 },
Float64Array: { [Function] BYTES_PER_ELEMENT: 8 },
DataView: [Function: DataView],