Skip to content

Instantly share code, notes, and snippets.

View taylor's full-sized avatar
🐢
🌊

Taylor Carpenter taylor

🐢
🌊
View GitHub Profile
@taylor
taylor / ruby-fmt.clj
Created September 29, 2012 03:38 — forked from blacktaxi/ruby-fmt.clj
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]))
@taylor
taylor / Gemfile
Created September 15, 2012 19:27
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@taylor
taylor / 0. nginx_setup.sh
Created August 19, 2012 02:24 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn
# Nginx+Unicorn best-practices congifuration guide.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@taylor
taylor / gist:3390437
Created August 18, 2012 23:57 — forked from botchagalupe/gist:737501
Setup a Three Server HAPROXY/APACHE2 Setup (New)

Setup a Three Server HAPROXY/APACHE2 Setup

Ubuntu Image used in class

image: ami-2e7e8747

Notes:  For Chef Clinet install use "sudo gem install chef --no-ri --no-rdoc" 

        Instead of knife ec2 .. use 
@taylor
taylor / gist:2716771
Created May 17, 2012 05:51 — forked from peterc/gist:40234
CAPTCHA plugin for Sinatra apps
# NAME: recaptcha
# VERSION: 1.0
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ]
# DESCRIPTION: Sinatra plugin to provide CAPTCHA support through recaptcha.net
# COMPATIBILITY: 0.3.2 /and/ latest rtomayko Hoboken builds!
# LICENSE: Use for what you want, just don't claim full credit unless you make significant changes
#
# INSTRUCTIONS:
# 0. Check out an extended client code example at the footer of this file
# 1. Ensure _this_ file is lib/recaptcha.rb within your app's directory structure
@taylor
taylor / captcha.rb
Created May 17, 2012 05:50 — forked from mikedamage/captcha.rb
Wolfram CAPTCHA Sinatra App
require 'rubygems'
require 'sinatra'
require 'nokogiri'
require 'digest'
require 'net/http'
require 'cgi'
configure do
set :config, YAML.load_file(File.join(File.dirname(__FILE__), 'config.yml'))
set :api_key, settings.config['api_key']
@taylor
taylor / fix_homebrew.rb
Created April 24, 2012 18:32 — forked from rpavlik/fix_homebrew.rb
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@taylor
taylor / winrm.rb
Created April 24, 2012 04:10 — forked from hh/mywinrm.rb
run a command on a windows box via winrm
#!/usr/bin/env ruby
require 'rubygems'
require 'winrm'
HOST=ARGV[0]
PASSWORD=ARGV[1]
COMMAND=ARGV[2] # 'hostname'
begin
winrm = WinRM::WinRMWebService.new( "http://#{HOST}:5985/wsman",
@taylor
taylor / ruby_skype_api_example.rb
Created April 19, 2012 21:19 — forked from ebisawa/ruby_skype_api_example.rb
Skype API example in Ruby
require 'dbus'
MYNAME = 'com.example.skype_api_client'
class SkypeAPI
def initialize(name = MYNAME)
bus = DBus.session_bus
service = bus.service("com.Skype.API")
objs = service.object("/com/Skype")
objs.introspect
@taylor
taylor / gist:2289396
Created April 3, 2012 05:03 — forked from le0pard/gist:1058405
Skypekit ruby Makefile
SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = ../../../../ext/skypekit4ruby
topdir = /home/leo/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1
hdrdir = /home/leo/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1
arch_hdrdir = /home/leo/.rvm/rubies/ruby-1.9.2-p180/include/ruby-1.9.1/$(arch)
VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby