Skip to content

Instantly share code, notes, and snippets.

Avatar

Doug McCall dhm116

  • State College, PA
View GitHub Profile
View pager_hapijs_routes.js
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 Jun 24, 2013
Sample Dockerfile resulting in `lookup failed` errors due to performing `make install` on the CDF library
View Dockerfile
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
Dagre.js Makefile for Windows
View Makefile
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 Feb 10, 2012
Python-based solvers for the embed.ly challenge
View embed.ly.solution.py
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 Feb 10, 2012
IE7/8 Javascript method shims
View ie.shims.js
'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 Jan 5, 2012
node-git repo instance output
View gist:1565276
{ 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],