This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Integer | |
def fact | |
downto(1).inject(:*) || 1 | |
end | |
end | |
def escape_routes(streets, avenues) | |
blocks = streets + avenues | |
blocks.fact/streets.fact/avenues.fact | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
sass: { | |
options: { | |
includePaths: ['bower_components/foundation/scss'] | |
}, | |
dist: { | |
options: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Zoas/palys - | |
Rastas | |
Darth Maul | |
Orange Darth Maul | |
Sunny D | |
Armor of God | |
Everlasting Gobstopper | |
Miami Vice | |
King Midas | |
Golden Jawbreakers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generate ctags with `rake ctags` | |
Run snipper.rb | |
Put resulting ruby.snippets file where your snippet plugin can pick it up. (I'm using snipmate) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shay@Shays-MacBook-Air:~/hashrocket/pointless(master)$ rvm use 1.9.2@harvester | |
Using /Users/shay/.rvm/gems/ruby-1.9.2-p136 with gemset harvester | |
shay@Shays-MacBook-Air:~/hashrocket/pointless(master)$ gem list | |
*** LOCAL GEMS *** | |
activesupport (3.0.4) | |
bundler (1.0.10, 1.0.9) | |
cgi_multipart_eof_fix (2.5.0) | |
columnize (0.3.2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- if Rails.env.test? || Rails.env.cucumber? | |
:javascript | |
jQuery.fx.off = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# shove this somewhere in your path | |
# gem install grit | |
# cd into project in questions directory | |
# run it | |
require 'rubygems' | |
require 'activesupport' | |
require 'grit' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def count_change(amount, denominations = [50,25,10,5,1]) | |
result = 1 | |
largest_denomination_count = 1 | |
until denominations.size == 1 | |
until makes_change?(amount, denominations, largest_denomination_count) == false | |
puts "change made with #{largest_denomination_count} coins of value #{denominations.first}" | |
result += 1 | |
largest_denomination_count += 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :application, "example.com" | |
set :deploy_to, "/var/www/#{application}" | |
role :app, "example.com" | |
role :web, "example.com" | |
role :db, "example.com", :primary => true | |
set :scm, :git | |
set :repository, "ssh://[email protected]/git/example.com" | |
set :branch, "origin/master" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/opt/local/bin/ruby | |
__DIR__ = File.join(File.dirname(__FILE__),"..") | |
framework = File.join(__DIR__,"framework") | |
if File.directory?(framework) | |
puts "Running from frozen framework" | |
core = File.join(framework,"merb-core") | |
if File.directory?(core) |
NewerOlder