Skip to content

Instantly share code, notes, and snippets.

View darrellnash's full-sized avatar

Darrell Nash darrellnash

View GitHub Profile

Keybase proof

I hereby claim:

  • I am darrellnash on github.
  • I am darrellnash (https://keybase.io/darrellnash) on keybase.
  • I have a public key ASDo4oaps3HMSJzy7izncnBgqmB0A2hSNgw0p6_4J4KCgQo

To claim this, I am signing this object:

@darrellnash
darrellnash / ns.rb
Created December 19, 2012 10:28
A small utility/wrapper around GNU screen for easily creating and re-attaching to a list of preferred sessions.
#!/usr/bin/env ruby
# use --help, or see HELP_TEXT directly below for more info
DEFAULT_NAMES = %w( screen1 screen2 screen3 screen4 )
COMMAND = File.basename(__FILE__)
HELP_TEXT =<<-EOD
Wrapper around screen, with a list of favored named sessions to create and attach to by default.
The intended use-case is to attach to the "next" detached screen session, which is useful if
@darrellnash
darrellnash / action_controller_extensions.rb
Created January 7, 2010 02:43 — forked from intridea/action_controller_extensions.rb
Fixed bug where request param wasn't being passed through to the original method [The full error was: ArgumentError (wrong number of arguments (0 for 1)): lib/extend_action_controller_conditions.rb:16:in `extract_request_environment_without_host']
# Originally from http://www.buildingwebapps.com/articles/7082-enhancing-conditional-routing-in-rails
# alias_method_chain added by intridea in http://gist.github.com/8615
require "action_controller"
module ActionController
module Routing
class RouteSet
def extract_request_environment_with_host(request)
extract_request_environment_without_host(request).merge({ :host => request.host })