Skip to content

Instantly share code, notes, and snippets.

View jschoolcraft's full-sized avatar

Jeff Schoolcraft jschoolcraft

View GitHub Profile
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
require 'bundler/capistrano'
set :rvm_ruby_string, '1.9.3'
set :rvm_type, :user
set :application, "net"
set :repository, "[email protected]:net.git"
@jschoolcraft
jschoolcraft / mountain-lion-brew-setup.markdown
Created August 2, 2012 22:30 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@jschoolcraft
jschoolcraft / gist:2876923
Created June 5, 2012 18:52 — forked from chrismdp/gist:2768532
Paypal IPN integration in about 30 lines of Sinatra.
diff --git a/app/account.rb b/app/account.rb
index a108685..c89ad34 100644
--- a/app/account.rb
+++ b/app/account.rb
@@ -1,4 +1,22 @@
+require 'open-uri'
+
module Sol
+ class Url
+ def self.get(url)
#! /usr/bin/env ruby
# Generate all tags for all gems included by bundler in gems.tags
#
# Basically does the same as "bundle show gemname", except for all gems.
# Interestingly enough, "bundle show" without any arguments falls back to
# "bundle list", otherwise the whole thing could have been a bash one-liner.
require 'bundler'
@jschoolcraft
jschoolcraft / os_x_free_memory.txt
Created April 12, 2012 19:48 — forked from remear/os_x_free_memory.txt
Free Memory Command on OS X
echo -e "\n$(top -l 1 | awk '/PhysMem/';)\n"
=> PhysMem: 1701M wired, 6232M active, 976M inactive, 8909M used, 3376M free.
Add to ~/.bash_profile
alias freemem="top -l 1 | awk '/PhysMem/'"
A more brief output:
@jschoolcraft
jschoolcraft / postgresql.rb
Created April 11, 2012 20:08 — forked from KronicDeth/postgresql.rb
Postgres 8.4.8 Homebrew forumula
require 'formula'
require 'hardware'
class Postgresql <Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.8/postgresql-8.4.8.tar.bz2'
md5 '4603e8ea30cee97189b62b39022f2043'
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old
@jschoolcraft
jschoolcraft / postgresql.rb
Created April 11, 2012 20:04 — forked from ryanwood/postgresql.rb
Postgres 8.4.6 Homebrew forumula
require 'formula'
require 'hardware'
class Postgresql < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp2.uk.postgresql.org/sites/ftp.postgresql.org/source/v8.4.6/postgresql-8.4.6.tar.bz2'
md5 'fcc3daaf2292fa6bf1185ec45e512db6'
depends_on 'readline'
depends_on 'libxml2' if MACOS_VERSION < 10.6 # Leopard libxml is too old
@jschoolcraft
jschoolcraft / hack.sh
Created March 31, 2012 11:30 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:

Add the default lucid32 base box to your vagrant, if you haven't already:

host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 

Now make a new lucid32 virtual machine and install postgresql on it:

@jschoolcraft
jschoolcraft / code_cleanup.sh
Created February 4, 2012 01:04
Used to clean up rubyish code, make unix line endings, tabs to spaces, kill trailing whitespace.
#!/bin/bash
main() {
find_files |
exclude_vcs_dirs |
exclude_common_dirs_that_are_not_ours |
exclude_extra_dirs |
cleanup_the_code
}