Skip to content

Instantly share code, notes, and snippets.

View jbonhag's full-sized avatar
🌊

Jeff Bonhag jbonhag

🌊
  • America/New_York
View GitHub Profile
var f;
function n(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==
b&&"undefined"==typeof a.call)return"object";return b}var aa="closure_uid_"+(1E9*Math.random()>>>0),ba=0;function ca(a,b){for(var c in a)b.call(void 0,a[c],c,a)};function ea(a,b){null!=a&&this.append.apply(this,arguments)}ea.prototype.ha="";ea.prototype.append=function(a,b,c){this.ha+=a;if(null!=b)for(var d=1;d<arguments.length;d++)this.ha+=arguments[d];return this};ea.prototype.toString=function(){return this.ha};var fa=null;function ga(){return new ha(nu
var express = require('express')
var app = express();
var cool = require('cool-ascii-faces');
var pg = require('pg');
app.set('port', (process.env.PORT || 5000))
app.use(express.static(__dirname + '/public'))
app.get('/db', function(request, response) {
pg.connect(process.env.DATABASE_URL, function(err, client, done) {
var pressure;
var jitter;
function setup() {
createCanvas(windowWidth, windowHeight);
pressure = 0;
jitter = 1;
noStroke();
}
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace DumbHtmlTemplate
{
[TestFixture]
public class DumbHtmlTemplateEngine
{
@jbonhag
jbonhag / Dockerfile
Created October 16, 2014 04:14
Quake in docker
FROM centos:centos7
RUN yum -y update
RUN yum -y install wget unzip
RUN wget http://quakeone.com/proquake/proquake-linux-dedicated-390-rc2.zip
RUN unzip proquake-linux-dedicated-390-rc2.zip
RUN chmod +x pqlinux
RUN mkdir id1
ADD pak0.pak id1/pak0.pak
EXPOSE 26000
CMD ["/pqlinux"]
import os
import argparse
import pymssql
class Column:
def __init__(self, row=None):
self.name = ''
self.data_type = 'object'
self.is_nullable = False
if row:
@jbonhag
jbonhag / database.yml
Created October 28, 2014 16:53
database.yml for IBM
# IBM Dataservers
#
# Home Page
# http://rubyforge.org/projects/rubyibm/
#
# To install the ibm_db gem:
#
# On Linux:
# . /home/db2inst1/sqllib/db2profile
# export IBM_DB_INCLUDE=/opt/ibm/db2/V9.7/include
@jbonhag
jbonhag / query_to_csv.rb
Created November 4, 2014 15:47
Use like `rails runner query_to_csv.rb parcels.sql`
require 'csv'
@connection = ActiveRecord::Base.connection
File.open(ARGV[0]) do |f|
stmt = @connection.exec_query(f.read)
rows = []
while row = IBM_DB.fetch_assoc(stmt)
rows << row
end
@jbonhag
jbonhag / -
Created December 12, 2014 14:11
doing the same thing with multiple exception types
private void TestMethod ()
{
Action<Exception> errorHandler = ( ex ) => {
// write to a log, whatever...
};
try
{
// try some stuff
}
#!/bin/zsh
key=$1
cmd="curl -s http://vindinium.org/api/training -d key=$key"
response=$(eval $cmd)
game_finished() {
echo $1 | jq .game.finished
}