Skip to content

Instantly share code, notes, and snippets.

View taylor's full-sized avatar
🐢
🌊

Taylor Carpenter taylor

🐢
🌊
View GitHub Profile
@ehlertij
ehlertij / gist:2897482
Created June 8, 2012 18:34
Chef recipes: proxy_up, proxy_down, haproxy_add, haproxy_remove
######################
# proxy_up.sh.erb
#!/bin/bash
echo 'Starting emproxy...'
sudo monit start all -g emproxy_ngin
echo 'Sleeping for 5s before reloading haproxy...'
sleep 5
echo 'Reloading haproxy...'
/data/ngin/shared/bin/haproxy_remove
@taylor
taylor / 98_command_prompt
Created March 15, 2012 21:01 — forked from matthewmccullough/gist:47267
command prompt tweaks -- git and last command status (smiley) + title bar updates for bashrc
# vim:ft=sh:
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
DARK_GRAY="\[\033[0;90m\]"
@blacktaxi
blacktaxi / ruby-fmt.clj
Created January 25, 2012 14:42
Ruby-like string interpolation in Clojure
; Ruby has an awesome feature -- string interpolation. Read about it on the internet.
; On the other hand, Clojure only has cumbersome Java string formatting, which can not be
; used without pain after you've tried Ruby.
; So here's this simple macro that basically allows you to do most things you could do
; with Ruby string interpolation in Clojure.
(ns eis.stuff
(:require [clojure.string]))
@pzol
pzol / README.md
Created January 13, 2012 18:11
capybara poltergeist test

This was a test with Poltergeist I did the other day

#!ruby
def polter
   noop

end

@Hal9000
Hal9000 / gist:1563600
Created January 5, 2012 03:41
Adhearsion fail - Ruby 1.9.2-p290 on OSX Lion: bundle exec rake -T
/Users/Hal/taylor/cc-adhearsion/vendor/bundle/gems/yard-0.7.4/lib/yard.rb:38: [BUG] Bus Error
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
-- control frame ----------
c:0021 p:---- s:0062 b:0062 l:000061 d:000061 CFUNC :callcc
c:0020 p:0080 s:0059 b:0059 l:001850 d:001850 TOP /Users/Hal/taylor/cc-adhearsion/vendor/bundle/gems/yard-0.7.4/lib/yard.rb:38
c:0019 p:---- s:0056 b:0056 l:000055 d:000055 FINISH
c:0018 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC :require
c:0017 p:0289 s:0050 b:0050 l:0017b8 d:0017b8 TOP /Users/Hal/taylor/cc-adhearsion/Rakefile:30
c:0016 p:---- s:0048 b:0048 l:000047 d:000047 FINISH
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
@bklang
bklang / extensions.conf
Created November 9, 2011 17:12
Adhearsion dev setup
[adhearsion]
exten => _.,1,AGI(agi://localhost/adhearsion)
@taylor
taylor / adhearsion_outgoing_call.rake
Created September 13, 2011 12:11 — forked from cloudvoxcode/adhearsion_outgoing_call.rake
place & receive a phone call with Ruby (Adhearsion)
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment")
require 'adhearsion'
require 'adhearsion/initializer/asterisk'
require 'drb'
# http://help.cloudvox.com/faqs/getting-started/setup-for-ruby-adhearsion
desc "Make an outgoing phone call to number provided as 'call' (via Cloudvox)"
task :make_outgoing_call do
if ENV['call']
# Outgoing context from Cloudvox Switchboard, under "Outgoing settings (AMI)."
@dgoujard
dgoujard / nginx
Created September 11, 2011 19:22
/etc/logrotate.d/nginx
/var/log/nginx/*.log {
daily
missingok
rotate 52
compress
delaycompress
notifempty
sharedscripts
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
@weavejester
weavejester / gist:1001206
Created May 31, 2011 20:27
Clojure on Heroku
~/$ lein new ring-on-heroku
Created new project in: /home/jim/Development/ring-on-heroku
~/$ cd ring-on-heroku
~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile
~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj
(ns ring-on-heroku.core
(:use ring.util.response
ring.adapter.jetty))
(defn app [req]