Skip to content

Instantly share code, notes, and snippets.

View groveriffic's full-sized avatar

Sam Ehlers groveriffic

View GitHub Profile
@groveriffic
groveriffic / consumer.rb
Created April 22, 2014 21:59
Basically 'cat' over AMQP to demonstrate exchanges and routing keys
require 'rubygems'
require 'bundler'
Bundler.require(:default)
Bunny.run(ENV['AMQP_URL']) do |conn|
routing_key = 'test.demonstration'
conn.with_channel do |ch|
queue = ch.queue('composinator.test.demonstration')
exchange = ch.direct('composinator')
@groveriffic
groveriffic / external_services_snippet_spec.rb
Created March 5, 2014 20:42
This automatically disables specs when the url is not specified via environment variable.
let(:ftp_url) {
if ENV['FTP_TEST_URL']
URI(ENV['FTP_TEST_URL'])
else
pending "Set ENV['FTP_TEST_URL'] to enable"
end
}
-- Prerequisites:
-- Boto: sudo pip install boto
-- Boto Config File: see https://code.google.com/p/boto/wiki/BotoConfig
-- Add PL Language Extensions
CREATE EXTENSION IF NOT EXISTS plpythonu;
CREATE OR REPLACE FUNCTION _s3_get(bucket text, key text)
RETURNS bytea AS $$
#!/bin/bash
git checkout master
git pull
git branch --remotes --merged | grep origin > .master_merged
git checkout release-staging
git pull
git branch --remotes --merged | grep origin > .staging_merged
diff .master_merged .staging_merged
rm .master_merged .staging_merged
class MetaDerp
### DENSE HORRIBLE CODE
# This should be broken up into smaller chunks possibly moved out into a mixin
# to hide it's horribleness
class << self
def hunt(name, *keys)
class_eval %[
def #{name}
#{keys.map{|key| "row[#{key.inspect}]" }.join(' || ')}
end
@groveriffic
groveriffic / pg_hba.conf
Created November 21, 2012 00:22
Postgres allows any user to connect from localhost to localhost
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
@groveriffic
groveriffic / mathlink.rb
Created August 31, 2012 03:33
jruby-mathlink
@groveriffic
groveriffic / .vimrc
Created April 4, 2012 18:48
My Vimrc
set wildmode=list,longest
if has("gui_running")
colorscheme darkblue
set guifont=Bitstream\ Vera\ Sans\ Mono\ Bold:h13
set guioptions-=T
endif
if has("gui_macvim")