Skip to content

Instantly share code, notes, and snippets.

View tomkersten's full-sized avatar

Tom Kersten tomkersten

View GitHub Profile
testing
@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;
/**
* Module dependencies.
*/
var express = require('express'),
routes = require('./routes'),
redis = require('redis'),
publisherClient = redis.createClient();
h1 Pub/Sub Updates
ul.data
#!/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"
@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
# 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 / 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;
}
@tomkersten
tomkersten / custom_vlad_tasks.rake
Created March 1, 2012 23:20
Vlad(/rake) task to let you know what you'd be deploying if you were to do so now...(based off your repo's 'origin' server master branch)
namespace :deploy do
desc "Show which commits would be deployed right now"
remote_task :what do
print "(Locally) Fetching current state of origin..."
`git fetch origin`
origin_master_head = `cat .git/refs/remotes/origin/master`.chomp
origin_head_details = `git log #{origin_master_head} --pretty=oneline -n 1`
puts origin_master_head
print "Current commit on server is..."
@tomkersten
tomkersten / gist:3948758
Created October 24, 2012 20:46
Maintaing GEM_HOME with rbenv + omg
# Trying to use http://blog.zenspider.com/blog/2012/09/ohmygems.html
#
# When I run "omg sample" and install a gem (via "gem install" or "bundle install"), it
# is still going into the "global" directory though.
#
# I may be doing something wrong, but, it seems like GEM_HOME is not being maintained
# in rbenv's shim commands.
#
# What am I doing wrong?