Skip to content

Instantly share code, notes, and snippets.

View tomkersten's full-sized avatar

Tom Kersten tomkersten

View GitHub Profile
@tomkersten
tomkersten / index.html
Created February 29, 2012 03:06
Playing around w/ d3.js...
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title></title>
<style>
.chart rect {
fill: steelblue;
stroke: white;
}
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Swap panes and maintain cursor
bind-key C-j swap-pane -D -d
bind-key C-k swap-pane -U -d
@tomkersten
tomkersten / gist:1447681
Created December 8, 2011 17:17
[Hacky script that] Pulls tickets from a chiliproject/redmine installation & dumps them to STDOUT. Works fine/well with @teddziuba's fork of hubot (https://github.com/teddziuba/hubot)
#!/usr/bin/env ruby
require 'httparty'
class Issue
BASE_URI = "http://your-chiliproject-uri-here/issues"
CHILI_API_KEY = ENV["HUBOT_CHILIPROJECT_API_KEY"] || raise("You must set the 'HUBOT_CHILIPROJECT_API_KEY' environment variable!")
include HTTParty
base_uri BASE_URI
#!/bin/bash
source /home/duckworth/.local_zshrc
CHICAGO_HOUR=`date +"%H"`
EHV_HOUR=$(($CHICAGO_HOUR+7))
echo "It's now $CHICAGO_HOUR o'clock in Chicago and $EHV_HOUR o'clock in EHV"
h1 Pub/Sub Updates
ul.data
/**
* Module dependencies.
*/
var express = require('express'),
routes = require('./routes'),
redis = require('redis'),
publisherClient = redis.createClient();
@tomkersten
tomkersten / somehost.conf
Created October 28, 2011 20:36
Nginx config with CORS headers added globally (for application w/ Basic Auth)
upstream your-app {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a
# single worker for timing out).
server unix:/tmp/your_app.socket fail_timeout=0;
}
server {
listen 80;
testing
@tomkersten
tomkersten / nginx.log
Created September 27, 2011 03:01
Why isn't this working?
# After shutting down the app servers, the clients (open browsers) get a dump
# of all messages which have been held back...and this is dumped out to the nginx log
2011/09/26 22:55:57 [error] 5042#0: *1 connect() failed (111: Connection refused) while
connecting to upstream, client: 204.51.3.162, server: somedomain.com, request:
"GET /stream/0D9A1580 HTTP/1.1", upstream: "http://127.0.0.1:5000/stream/0D9A1580",
host: "somedomain.com", referrer: "http://somedomain.com/tags/0D9A1580/"