Skip to content

Instantly share code, notes, and snippets.

@ryanb
ryanb / spec_helper.rb
Created September 12, 2011 21:29
Focus on specific specs in RSpec
# add this to your spec helper
RSpec.configure do |config|
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end
# and then use the :focus tag in your specs
it "does something awesome", :focus do
$ rvm_archflags="-arch i386 -arch x86_64" ARCHFLAGS="-arch i386 -arch x86_64" CFLAGS='-arch i386 -arch x86_64' LDFLAGS='-arch i386 -arch x86_64' rvm pkg install zlib
Fetching zlib-1.2.5.tar.gz to /Users/rbates/.rvm/archives
Extracting zlib-1.2.5.tar.gz to /Users/rbates/.rvm/src
Configuring zlib in /Users/rbates/.rvm/src/zlib-1.2.5.
Compiling zlib in /Users/rbates/.rvm/src/zlib-1.2.5.
ERROR: Error running '/usr/bin/make ', please read /Users/rbates/.rvm/log/zlib/make.log
Installing zlib to /Users/rbates/.rvm/usr
ERROR: Error running '/usr/bin/make install', please read /Users/rbates/.rvm/log/zlib/make.install.log
$ cat /Users/rbates/.rvm/log/zlib/make.log
@ryanb
ryanb / rails_3_1_update.txt
Created July 23, 2011 21:31
Possible output from a Rails 3.1 upgrade wizard
$ rake rails:update
Generating app/assets directory and content. (same as 3.1 app generator)
Do you want to move all public/stylesheets into app/assets/stylesheets? (recommended) [y]
Moving public/stylesheets into app/assets/stylesheets...
Existing application.css, merging content to the end of app/assets/stylesheets/application.css.
@ryanb
ryanb / deploy.rb
Created July 12, 2011 16:14
Check to see if you have changes in head which have not been pushed before deploying
namespace :deploy do
desc "Make sure there is something to deploy"
task :check_revision, :roles => :web do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts "WARNING: HEAD is not the same as origin/master"
puts "Run `git push` to sync changes."
exit
end
end
end
@ryanb
ryanb / railscasts_episodes.txt
Created June 29, 2011 21:41
List of all RailsCasts episode names with numbers
001-caching-with-instance-variables
002-dynamic-find-by-methods
003-find-through-association
004-move-find-into-model
005-using-with-scope
006-shortcut-blocks-with-symbol-to-proc
007-all-about-layouts
008-layouts-and-content-for
009-filtering-sensitive-logs
010-refactoring-user-name-part-1
@ryanb
ryanb / README.md
Created May 15, 2011 16:24 — forked from copiousfreetime/my-gh-issues.rb
My Github Issues

First install the required gems:

gem install octokit awesomeprint rainbow

Then run it to extract all of your open GitHub issues into files (with comments).

ruby my-gh-issues.rb
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.

Website Hosting

@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
@ryanb
ryanb / application.html.erb
Created January 19, 2011 19:31
Example of very simple password authentication.
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>