Skip to content

Instantly share code, notes, and snippets.

View Workman's full-sized avatar

Reid Workman Workman

View GitHub Profile
@Workman
Workman / template.rb
Last active August 29, 2015 14:10
Ruby Puzzle Template
def main
checkInput
end
def checkInput stackCount=0
stackCount = gets.strip.to_i+1 if stackCount == 0
doInputWork gets.strip
return if stackCount <= 1
checkInput stackCount-1
end
@Workman
Workman / inFibo.rb
Last active August 29, 2015 13:56
Is it in Fibo? (Hint: Cake is not a fibo.)
#!/usr/bin/env ruby
def inFibo? f
if f.is_a? Array
f = [ f[1], (f[0] + f[1]), f[2] ]
#puts "#{f.inspect} ? #{f[1]} == #{f[2]}"
if f[1] < f[2]
return inFibo? f
elsif f[1] == f[2]
return true
end
@Workman
Workman / gist:7554320
Created November 19, 2013 23:14
Another handy template for bootstrapping applications
rails new rails-bootstrap -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
@Workman
Workman / rapidrails.rb
Last active March 28, 2020 06:42
Have a web service idea? Prototype it with Rapid Rails!
#!/usr/bin/env ruby
# ruby -e "$(curl -L https://gist.githubusercontent.com/Workman/7554012/raw/)" project_name
# Clones RapidRails and sets up local dev environment
require 'securerandom'
abort("You didn't specify a name for your app!") if !ARGV[0] || ARGV[0].empty?
def prompt(*args)
print(*args)
STDIN.gets.chomp