Skip to content

Instantly share code, notes, and snippets.

View nordringrayhide's full-sized avatar

Nodrin Grayhide nordringrayhide

  • home
  • Worldwide
View GitHub Profile
# Then in your features you'll only need to call the `login_as` or `logout`
# methods. More info here: http://wiki.github.com/hassox/warden/testing
feature "Home page" do
background do
@user = User.create(...) # Or use fixtures, factories or whatever, even a
# stub user
login_as @user
visit home_page
if __FILE__ == $0
puts "Run with: watchr #{__FILE__}. \n\nRequired gems: watchr rev"
exit 1
end
# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def run(cmd)
puts(cmd)
@nordringrayhide
nordringrayhide / watchr-runner.rb
Created August 9, 2011 06:23 — forked from rud/watchr-runner.rb
watchr for rspec
if __FILE__ == $0
puts "Run with: watchr #{__FILE__}. \n\nRequired gems: watchr rev"
exit 1
end
# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def run(cmd)
puts(cmd)
@nordringrayhide
nordringrayhide / carbon.md
Created October 7, 2011 04:38 — forked from wilson/carbon.md
use ruby instead of perl

Vim

autocmd BufWritePre * :%s/\s\+$//e

Emacs

(add-hook 'before-save-hook 'delete-trailing-whitespace)

Textmate

@nordringrayhide
nordringrayhide / gist:1285686
Created October 13, 2011 22:08 — forked from bryckbost/gist:1040263
Capybara 1.0 and Chrome
# env.rb
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
Download chromedriver from http://code.google.com/p/selenium/downloads/list
mv chromedriver to /usr/local/bin so it's in your path.
@nordringrayhide
nordringrayhide / gist:1311710
Created October 25, 2011 07:27 — forked from gutenye/gist:1300152
disable suite and test in RSpec
# put this in spec_helper.rb
module Kernel
private
def xdescribe(*args, &blk)
describe *args do
pending "xxxxxxxxx"
end
end
@nordringrayhide
nordringrayhide / ruby_debug_pow.markdown
Created December 10, 2011 06:57 — forked from alexagui/ruby_debug_pow.markdown
How to Ruby Debug with Pow

How to Ruby Debug with Pow

Below are steps I followed to get ruby debugger ruby-debug running with Pow. Based on info from this thread basecamp/pow#43 and this blog post http://flochip.com/2011/04/13/running-pow-with-rdebug/

1) Update your Gemfile

Assuming you're writing your app in Ruby 1.9 and using Bundler, just add the dependency to your development gems:

@nordringrayhide
nordringrayhide / service
Created January 20, 2012 08:25 — forked from brentkirby/service
Unicorn + Runit + RVM
#!/bin/bash -e
#
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls
# to the service and redirect them to unicorn directly.
#
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn.
#
function is_unicorn_alive {
@nordringrayhide
nordringrayhide / Gemfile
Created February 29, 2012 06:51 — forked from d--j/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
group :development do
# bundler requires these gems in development
gem 'rails-footnotes'
end
group :test do

Using rails_admin without devise

Having a buckload of code to authorize users on your application is something you may like or not. Speaking for myself I hate it. But I still love rails_admin, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.

Add RailsAdmin to your Gemfile

do NOT add devise

gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"