Skip to content

Instantly share code, notes, and snippets.

View taylor's full-sized avatar
🐢
🌊

Taylor Carpenter taylor

🐢
🌊
View GitHub Profile
# So I bought this PDF book on ActiveMerchant from Peepcode.
# It's tests use Test::Unit, I was using RSpec. So I translated them.
# http://peepcode.com/products/activemerchant-pdf
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
include ActiveMerchant::Billing
describe OrderTransaction do
before do
@amount = 100
@taylor
taylor / aws_cf_invalidate.rb
Created May 27, 2011 07:29 — forked from jmlacroix/aws_cf_invalidate.rb
Command line script to invalidate cloudfront objects
require 'rubygems'
require 'hmac-sha1'
require 'net/https'
require 'base64'
s3_access='S3_ACCESS_KEY'
s3_secret='S3_SECRET_KEY'
cf_distribution='CLOUDFRONT_DISTRIBUTION_ID'
if ARGV.length < 1
@taylor
taylor / GoogleVoiceDialerAction.scpt
Created June 27, 2011 06:41 — forked from matthewtodd/GoogleVoiceDialerAction.scpt
Command-line Google Voice dialer and Mac OSX Address Book Plug-In
-- Drop this script in ~/Library/Address Book Plug-Ins
-- Edit the path in the "do shell script" line
using terms from application "Address Book"
on action property
return "phone"
end action property
on action title for aPerson with aNumber
return "Dial with Google Voice"
end action title
@taylor
taylor / adhearsion-rhel5.sh
Created August 26, 2011 04:32 — forked from bklang/adhearsion-rhel5.sh
Adhearsion QuickStart for RedHat Enterprise Linux/CentOS 5
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
source /usr/local/rvm/scripts/rvm
echo "source /usr/local/rvm/scripts/rvm" >> $HOME/.profile
yum install -y bash curl gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel iconv-devel
rvm install 1.9.2
rvm use --default 1.9.2
gem install bundler
@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)."
@taylor
taylor / extensions.conf
Created December 5, 2011 21:06 — forked from bklang/extensions.conf
Adhearsion dev setup
[adhearsion]
exten => _.,1,AGI(agi://localhost/adhearsion)
@taylor
taylor / mount-ram.sh
Created December 22, 2011 00:19 — forked from koshigoe/mount-ram.sh
Like tmpfs in Mac OSX
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
@taylor
taylor / daemon.rb
Created January 1, 2012 10:47 — forked from ik5/daemon.rb
a quick and dirty jruby daemon based on basic_daemon
#!/usr/bin/env jruby
#
#
require 'rubygems'
require 'spoon'
EXEC = '/tmp/exec.rb'
PID_PATH = '/tmp/exec.pid'
WORK_PATH = '/tmp/'
@taylor
taylor / Gemfile
Created February 15, 2012 10:28
Testing Ruby VMs
source :rubygems
gem 'sinatra'
gem 'sinatra-synchrony'
gem 'thin'
@taylor
taylor / rbenv-install-system-wide.sh
Created February 15, 2012 22:24
rbenv install and system wide install on Ubuntu 10.04 LTS.
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path: