Skip to content

Instantly share code, notes, and snippets.

View nordringrayhide's full-sized avatar

Nodrin Grayhide nordringrayhide

  • home
  • Worldwide
View GitHub Profile
module Chef
class Recipe
def search
puts 'A'
end
end
end
module LocalSearch
def search
@nordringrayhide
nordringrayhide / gist:1513431
Created December 23, 2011 07:02
Remove Jenkins plugin
cd /Users/Shared/Jenkins/Home/plugins
sudo remove plugin-name*
sudo launchctl unload -w /Library/LaunchDaemons/org.jenkins-ci.plist
sudo launchctl load -w /Library/LaunchDaemons/org.jenkins-ci.plist
@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 / 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 / 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 / nginx-maintenance-mode
Created October 13, 2011 18:37
Rails-Nginx maintenance mode with resources acceess
# Enable maintenance.html page. This is used with advanced capistrano configuration.
set $maintenance 0;
if (-f $document_root/system/maintenance.html) { set $maintenance 1; }
if ($request_uri ~* (jpg|jpeg|gif|png|ico|js|css)$) { set $maintenance 0; }
if ($maintenance) { rewrite ^(.*)$ /system/maintenance.html last; break; }
https://boxpanel.bluebox.net/public/the_vault/index.php/Custom_Rails_Maintenance_Pages_With_Capistrano
@nordringrayhide
nordringrayhide / capybara-screenshot
Created October 13, 2011 05:31
Capybara screenshot
module Capybara
module Screenshot
module World
def screen_shot_and_save_page
require 'capybara/util/save_and_open_page'
path = "/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}"
puts "After body from within Gem: #{page.body}"
Capybara.save_page body, "#{path}.html"
if page.driver.respond_to?(:render)
page.driver.render Rails.root.join "#{Capybara.save_and_open_page_path}" "#{path}.png"
@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:1213229
Created September 13, 2011 06:03
Vim code highligt via directive at comments
# vim: syntax=ruby
Gemfile
@nordringrayhide
nordringrayhide / spec.opts
Created September 3, 2011 07:50
rspec 1.x option file
--colour
--format profile
--loadby mtime
--reverse
--backtrace