This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.
— Erik
| # By Steve Leung | |
| # steve@leungs.me | |
| class ActiveRecord::Relation | |
| # temporarily hack for allowing combining scopes with OR | |
| # doesn't add the join tables so need to use .includes manually | |
| # ie. Jobship.includes(:job).or(Jobship.accepted, Jobship.declined).count | |
| def or(*scopes) | |
| clauses = *scopes.map do |relation| |
| require "rubygems" | |
| require "octokit" # gem install octokit | |
| 1.upto(5) do |page| | |
| Octokit.repositories("railscasts", page: page, per_page: 100).each do |repo| | |
| system "git clone git://github.com/railscasts/#{repo.name}" | |
| end | |
| end |
by Jonathan Rochkind, http://bibwild.wordpress.com
Capistrano automates pushing out a new version of your application to a deployment location.
I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".
| module Capybara | |
| def Capybara.auto_save_and_open_page=(val) | |
| @auto_save_and_open_page = !!val | |
| end | |
| def Capybara.auto_save_and_open_page? | |
| @auto_save_and_open_page ||= false | |
| end | |
| end |
| brew update | |
| brew versions FORMULA | |
| cd `brew --prefix` | |
| git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
| brew install FORMULA | |
| brew switch FORMULA VERSION | |
| git checkout -- Library/Formula/FORMULA.rb # reset formula | |
| ## Example: Using Subversion 1.6.17 | |
| # |
This gist assumes:
| require 'methodfinder' | |
| # _why's MethodFinder addition tweaked and revised. | |
| # <http://redhanded.hobix.com/inspect/stickItInYourIrbrcMethodfinder.html> | |
| class MethodFinder | |
| def self.with_redirected_streams | |
| redirect_streams | |
| yield | |
| ensure |
| #!/usr/bin/ruby | |
| require 'rss' | |
| # Usage | |
| # $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/ | |
| # episodes.rss | |
| # OR | |
| # $ ./railscasts.rb | |
| p 'Downloading rss index' |