Public Gists by cwsaylor

Gravatar
Sat Nov 14 08:14:35 -0800 2009
1
2
3
db_config = YAML::load(File.read(RAILS_ROOT + "/config/mongodb.yml"))
 
if db_config[RAILS_ENV] && db_config[RAILS_ENV]['adapter'] == 'mongodb'
Gravatar
Tue Nov 03 09:18:05 -0800 2009
1
2
3
URL_CHARS = ('0'..'9').to_a + ('a'..'z').to_a + ('A'..'Z').to_a + ['-', '_'] - ['a', 'e', 'i', 'o', 'u'] - ['A', 'E', 'I', 'O', 'U']
URL_BASE = URL_CHARS.size
 
gist: 217060 Demonstrates how easy it is...
Gravatar
Fri Oct 23 10:23:36 -0700 2009
1
2
3
require 'json'
require 'open-uri'
require 'mongo'
Gravatar
Tue Oct 20 09:08:48 -0700 2009
1
2
3
# drop into config/deploy.rb
 
desc "Symlink public cache"
Gravatar
Sat Oct 03 13:04:24 -0700 2009
1
2
3
user deploy deploy;
worker_processes 1;
 
gist: 186878 Snow Leopard Developer Setup
Gravatar
Mon Sep 14 12:40:13 -0700 2009
1
2
3
== Install the Developer Tools from the Snow Leopard DVD
I mostly follow HiveLogic except for paths. I use the Mac OS X way of setting paths. I also compile everything into it's own folder for easy upgrading.
 
Gravatar
Mon Sep 14 10:59:33 -0700 2009
1
2
3
# Based on Evan Weaver's config and altered slightly to work on Ubuntu 9.04
# as a drop in to /etc/mysql/conf.d/custom.cnf
#
Gravatar
Mon Sep 14 10:55:19 -0700 2009
1
2
3
# Anything between dashes gets copied into the file preceding it.
# Brackets hold notes and instructions
 
Gravatar
Thu Sep 03 17:27:59 -0700 2009
1
2
3
class Link
  def initialize
    @links = []
Gravatar
Sun Aug 02 14:19:15 -0700 2009
1
2
3
#!/usr/bin/env ruby
require 'rubygems'
require 'tinder'
gist: 90971 Capistrano deployment campf...
Gravatar
Mon Apr 06 15:07:49 -0700 2009
1
2
3
# Requires config file config/campfire.yml with the following settings:
 
# account: "foo"
gist: 74918 Compile Readline on Mac OS X
Gravatar
Fri Mar 06 06:18:24 -0800 2009
1
2
3
# Compile readline on Mac OS X
 
cd /usr/local/src
gist: 74430 Install ImageMagick for onl...
Gravatar
Thu Mar 05 08:46:44 -0800 2009
1
2
3
# Get http://www.ijg.org/files/jpegsrc.v6b.tar.gz
 
  tar zxvf jpegsrc.v6b.tar.gz
Gravatar
Sat Jan 31 15:45:18 -0800 2009
1
2
3
# Customize the terminal tabs
# put this in your .profile or .bashrc
function settitle() { echo -ne "\e]2;$@\a\e]1;$@\a"; }
Gravatar
Fri Nov 07 20:05:49 -0800 2008
1
2
3
## ~/bin/hg-growl.rb
 
#!/usr/bin/env ruby
Gravatar
Fri Oct 17 13:50:06 -0700 2008
1
2
3
# run with: god -c /etc/god/mongrel_cluster_god.rb or use an init.d script
#
# This god script will monitor all of your mongrels that are setup with mongrel_cluster.
gist: 17522 God init.d script
Gravatar
Fri Oct 17 13:46:17 -0700 2008
1
2
3
#!/bin/bash
#
# god Startup script for God monitoring tool.
gist: 8511 hack sink ship
Gravatar
Tue Sep 02 17:53:41 -0700 2008
1
2
3
# Variation on Hashrocket's script for managing the git process
# as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# Create shell scripts out of each of these, put them in your path (~/bin for example)
gist: 8508 Script to generate a csv fi...
Gravatar
Tue Sep 02 17:42:46 -0700 2008
1
2
3
#! /usr/bin/env ruby
 
# Usage: ruby bill_generator.rb data.yml 2008-1-1 2008-12-31
gist: 8429 data_scrub.rake
Gravatar
Tue Sep 02 09:44:08 -0700 2008
1
2
3
# Scrub your production data for use in your development/staging environments. Sets all passwords to 12345
# and email addresses to your email address in the format of email+id@domain.com. Gmail (among others) allow
# you to add extra info to your email address with a +.