Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am subakva on github.
* I am subakva (https://keybase.io/subakva) on keybase.
* I have a public key ASCxKYLz1pYdMG5COKJyLIdnksvyvTu9BkfZOM6lj5KM7Qo
To claim this, I am signing this object:
@subakva
subakva / gist:7828118
Last active December 30, 2015 12:19 — forked from ericboehs/gist:7125105
require 'capybara/poltergeist'
module Capybara::Poltergeist
class Client
private
def redirect_stdout
prev_out = STDOUT.dup
prev_out.autoclose = false
$stdout = @write_io
STDOUT.reopen(@write_io)
@subakva
subakva / .powrc
Created May 18, 2012 21:05
Load Foreman .env file in .powrc
for ENV_DECL in `cat .env`
do
export $ENV_DECL
done
@subakva
subakva / touchable_model.rb
Created March 18, 2011 22:47
TouchableModel
module TouchableModel
def self.included(model)
model.extend(TouchableModel::ClassMethods)
model.send(:include, TouchableModel::InstanceMethods)
underscore_name = model.name.underscore.singularize
plural_name = underscore_name.pluralize
# Include this module to have any related class set the updated_at field after it is saved
# after they are saved. The class is expected to have an association that matches the
@subakva
subakva / shareable_route_set.rb
Created August 29, 2010 15:22
Class to allow the creation of Rails route helpers for external applications without interfering with the application routes
class ShareableRouteSet
include ActionController::UrlWriter
def initialize
@route_set = ActionController::Routing::RouteSet.new
@map = ActionController::Routing::RouteSet::Mapper.new(@route_set)
self.draw(@map)
self.install_public_helpers
end
@subakva
subakva / github_bulk_hook_hack.rb
Created April 22, 2010 18:33
Mechanize script to bulk edit github hooks
#! /usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'logger'
projects = %w{
project_name_1
project_name_2
}