Skip to content

Instantly share code, notes, and snippets.

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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
includePaths: ['bower_components/foundation/scss']
},
dist: {
options: {
@shayarnett
shayarnett / inventory.txt
Created January 13, 2013 19:30
Coral Stocking List
- Zoas/palys -
Rastas
Darth Maul
Orange Darth Maul
Sunny D
Armor of God
Everlasting Gobstopper
Miami Vice
King Midas
Golden Jawbreakers
@shayarnett
shayarnett / README
Created May 10, 2012 13:13
Snippet generator for RubyMotion ctags
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)
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)
- if Rails.env.test? || Rails.env.cucumber?
:javascript
jQuery.fx.off = true;
#!/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'
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
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://shay@example.com/git/example.com"
set :branch, "origin/master"
#!/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)