Skip to content

Instantly share code, notes, and snippets.

View akitaonrails's full-sized avatar

Fabio Akita akitaonrails

View GitHub Profile
RubyConf
RailsConf
RailsConf EU
acts_as_conference
Euruko
Ruby Kaigi
Mountain West RubyConf
eRubyCon
Ruby Hoedown
Amsterdam Ruby en Rails
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)
# 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.)
#
# 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'
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:
#!/usr/bin/env zsh
if [[ -s "${TM_PROJECT_DIRECTORY}/.rvmrc" ]]
then
source "${TM_PROJECT_DIRECTORY}/.rvmrc"
fi
`which ruby` $*
@akitaonrails
akitaonrails / Gemfile
Created April 23, 2011 00:04 — forked from rmoriz/Gemfile
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
@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/**