Skip to content

Instantly share code, notes, and snippets.

View akitaonrails's full-sized avatar

Fabio Akita akitaonrails

View GitHub Profile
@akitaonrails
akitaonrails / mountain-lion-brew-setup.markdown
Created June 18, 2012 13:43 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion Preview 4 and Homebrew to Be Happy

Get Mountain Lion Preview 4 and Homebrew to Be Happy

1) Install XCode 4.5 Developer Preview into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

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

@akitaonrails
akitaonrails / gist:1724673
Created February 2, 2012 17:22 — forked from mattmanning/gist:1430691
Fixing Apachebench on OS X Lion
# If you're getting this error trying to use ApacheBench on OS X Lion:
# Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54)
#
# You need to download the latest beta version of Apache and rebuild ab.
# Here's how (assuming you have homebrew installed).
# Install Homebrew (https://github.com/mxcl/homebrew) and then the Perl Regex support
brew install pcre
# Download the latest from http://httpd.apache.org/download.cgi, then decompress and compile it
@akitaonrails
akitaonrails / .gitignore
Created May 8, 2011 07:08 — forked from fnando/rubygems_proxy.rb
Rack app for caching RubyGems files. Very useful in our build server that sometimes fails due to our network or rubygems.org timeout.
.DS_Store
*.swp
*.swo
log/**
tmp/**
cache/**
@akitaonrails
akitaonrails / Gemfile
Created April 23, 2011 00:04 — forked from rmoriz/Gemfile
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
#!/usr/bin/env zsh
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]]
then
source "${TM_PROJECT_DIRECTORY}/.rvmrc"
fi
`which ruby` $*
This is an example of using RVM's Project .rvmrc file
to have it automatically bootstrap your environment, including bundler.
This could be further expanded to do anything you require :)
The important thing to remember is that the purpose of these files is
to allow you to very easily have your 'project context' (aka 'environment')
loaded automatically for you when you enter the project in the shell (cd).
You can generate the .rvmrc file below by running:
#
# Instructions:
#
# * Download Microsoft Journal Sample code February 1997:
#
# http://globalfilesearch.com/download.aspx?path=ringtail.its.monash.edu.au/pub/msj/newfiles/MSJFEB97.EXE
#
# * Extract depends.exe from 'Under the Hood' folder and place along this script.
#
# * call it with 'ruby detect.rb'
# Hey coops..
#
# Imagine yourself on the other side of the table: two job openings, hundreds of resumes,
# _all of which_ look friggin' identical. Yeah, the HR departments at your MegaCorp XYZ are using
# automated tools to scan for keywords, and the coop department at your school is trying to beat
# you into submission to follow some "predefined template".. But, unless what you're aspiring to
# is to be an automaton at MegaCorp XYZ, relegated to writing test harnesses for code that will
# never see the light of day.. please do yourself a favor, and _be different_! Be bold, dammit.
#
# (Frankly, I'm falling asleep while reading your resumes.. Wake me up! Srsly.)
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)