Skip to content

Instantly share code, notes, and snippets.

View cstrahan's full-sized avatar

Charles Strahan cstrahan

  • Backtrace
  • Dallas, TX
View GitHub Profile
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@cstrahan
cstrahan / .gitignore
Created August 6, 2012 13:46 — forked from TooTallNate/.gitignore
low-level objc runtime apis
*
!*.m
!Makefile
@cstrahan
cstrahan / .bash_login.jenkins
Created August 28, 2012 21:30 — forked from fancyremarker/.bash_login.jenkins
[ARTSY] Scripts related to Jenkins client setup
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
@cstrahan
cstrahan / chicken.rb
Created August 31, 2012 13:50 — forked from tenderlove/chicken.rb
YARV bytecode compiler for Scheme
###
# Scheme code is translated to YARV byte code, then evaluated in the
# Ruby Virtual Machine
require 'rbconfig'
require 'dl'
require 'fiddle'
require 'strscan'
class RubyVM
@cstrahan
cstrahan / emoji_sad.txt
Created November 27, 2012 18:18 — forked from mranney/emoji_sad.txt
Why we can't process Emoji anymore
From: Chris DeSalvo <[email protected]>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <[email protected]>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@cstrahan
cstrahan / .rspec
Created December 28, 2012 19:37 — forked from coreyhaines/.rspec
--colour
-I app

How I Work, Part 1: Ruby

Since the first of the year I've been trying to write one of that sort of post where the blogger describes the tools they use. Obviously, I haven't succeeded yet. And what's more, it's taken me until now to precisely identify why it's been so hard.

It's not that I find these "setup" posts to be a form of pornography. They are, and I do, but in this scenario I would be the porn star, not the lonely guy who looks for tips on productivity blogs in lieu of an actual life. And it's not that my setup isn't interesting. It's not that mind-blowing or innovative, honestly, but over the years I've learned a lot about what I need to do my job and that knowledge feels worth sharing.

What I've concluded, rather, is that in trying to talk about my tools in a single post, I was going about it totally the wrong way. Tools and best practices are things I care deeply about, and trying to cram everything into a single, 5,000-word monster post would be exhausting for me to write, at least as tir

#!/usr/bin/env ruby
%w(erb git net/ssh resolv chef chef/knife/cookbook_upload chef/cookbook_uploader chef/knife/node_run_list_add chef/knife/bootstrap net/ssh/multi chef/knife/core/bootstrap_context chef/knife/ssh mixlib/cli).each do |gem|
begin
require gem
rescue LoadError
raise "Could not load gem #{gem}, please install with sudo gem install #{gem}"
end
end
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC
"-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.bitlbee</string>
<key>ProgramArguments</key>
<array>
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password [download_directory]
require 'mechanize'
# gem 'mechanize-progressbar'
email = ARGV[0] or raise('Please provide the email address for your account')
password = ARGV[1] or raise('Please provide the password for your account')
path = ARGV[2] || './'