This file contains hidden or 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
| (defn map-months | |
| [coll] | |
| (if (seq coll) | |
| [(:created_at (first coll) (recur (rest coll)))] | |
| [])) | |
| ; Can only recur from tail position |
This file contains hidden or 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
| --type-add=ruby=.haml,.bldr | |
| --type-add=js=.coffee |
This file contains hidden or 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
| require 'rubygems' | |
| require 'em-proxy' | |
| Proxy.start(:host => '0.0.0.0', :port => 8082, :debug => true) do |conn| | |
| conn.server :one, :host => '127.0.0.1', :port => 8080 | |
| conn.server :two, :host => '127.0.0.1', :port => 8081 | |
| conn.on_data do |data| | |
| data | |
| end |
This file contains hidden or 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 | |
| output = `ruby -r bench_press ./benchmark.rb` | |
| results = File.open(File.expand_path(File.dirname(__FILE__)) + "/results.txt", "a") do |f| | |
| f.puts "\n" | |
| f.puts "=" * 80 | |
| f.puts "Spec run time: #{Time.now}" | |
| f.puts "Git SHA: #{`cat ../.git/\`cat ../.git/HEAD | awk '{print $2}'\``.chomp}" | |
| f.puts output |
This file contains hidden or 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
| // Adds a live filter box to the results screen on craigslist | |
| // that filters the results that are currently on the page by | |
| // the search term. Like Cmd-F, but better. | |
| // NOTE: Requires dotjs. | |
| // Cmd-F live search | |
| var searchBox = $('<input type="text" id="result-search" />') | |
| $("h4.ban:first").before(searchBox) |
This file contains hidden or 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 Credential | |
| include Mongoid::Document | |
| end | |
| class Credential::Password < Credential | |
| field :password | |
| field :email | |
| end | |
| class User |
This file contains hidden or 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 | |
| # Usage: land-feature | |
| current_branch = `git branch | grep '\*' | awk '{print $2}'`.chomp | |
| unless current_branch.include?("feature") | |
| puts "You are not current on a feature branch." | |
| exit(1) | |
| end |
This file contains hidden or 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 | |
| # Usage: cut-release [major|minor|tiny] | |
| current_version = File.read("VERSION").chomp | |
| next_version = current_version.succ | |
| release_type = ARGV[1] || "tiny" | |
| system("git flow release start #{next_version} && rake version:bump:#{release_type}") |
This file contains hidden or 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
| /Users/ajsharp/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY | |
| /Users/ajsharp/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED | |
| WARNING: Global access to Rake DSL methods is deprecated. Please include | |
| ... Rake::DSL into classes and modules which use the Rake DSL methods. | |
| WARNING: DSL method RSpec::Core::RakeTask#ruby called at /Users/ajsharp/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:36:in `ruby' | |
| rake aborted! | |
| stack level too deep | |
| /Users/ajsharp/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/file_utils_ext.rb:116 |
This file contains hidden or 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
| require 'rake/dsl_definition' | |
| require 'rake' | |
| include Rake::DSL | |
| desc 'Run all the tests' | |
| task :default => :spec | |
| require 'rspec/core/rake_task' | |
| RSpec::Core::RakeTask.new do |t| |