Skip to content

Instantly share code, notes, and snippets.

Brian Takita btakita

Block or report user

Report or block btakita

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7376
export MOZ_NO_REMOTE=1
export DISPLAY=:0.0
nohup selenium >> /var/log/selenium.log 2>&1 &
View gist:10170
.table {
display: table;
width: 95%;
border-spacing: 2px 2px;
border-color: gray;
border-collapse: collapse;
}
.table-caption {
display: table-caption;
View add_to_fstab
/dev/sda1 / ext3 relatime,errors=remount-ro 0 1
View git log
commit 41df2a49059616a1103b6276fb1bee1a18b21d01
Author: Brian Takita <btakita@btakita-laptop.(none)>
Date: Sat Nov 29 18:44:56 2008 -0500
Changed RecordedCalls#matches? to #match_error in anticipation of having reasons a match fails.
View gist:57165
module Capistrano::Configuration::Connections
alias_method :execute_on_servers_without_ignoring_no_matching_server_error, :execute_on_servers
def execute_on_servers_with_ignoring_no_matching_server_error(*args, &block)
execute_on_servers_without_ignoring_no_matching_server_error(*args, &block)
rescue Capistrano::NoMatchingServersError => e
logger.info "skipping `#{current_task.fully_qualified_name}' because no servers matched"
end
alias_method :execute_on_servers, :execute_on_servers_with_ignoring_no_matching_server_error
end
View gist:60463
Erector::Widgets::Table.create do
column :first_name
column :last_name
column :email
row_classes :even, :odd
end.insert(self, :row_objects => users)
#################
widget(Erector::Widgets::Table.create do
View gist:74480
# TODO: BT - Remove this when this is integrated into RR.
#Adding this monkey patch to get around issue with Double R and named scopes
RR::DoubleInjection.class_eval do
def initialize(subject, method_name)
@subject = subject
@method_name = method_name.to_sym
if object_has_method?(method_name)
begin
meta.__send__(:alias_method, original_method_name, method_name)
rescue NameError => e
View application_controller.rb
class ApplicationController < ActionController::Base
protected
def update_page(callback_base_name = @action_name, &block)
callback_name = "on_#{callback_base_name}"
render :update do |page|
args = block ? instance_eval(&block) : []
args = [args] unless args.is_a?(Array)
page << "page.#{callback_name}.apply(page, #{args.to_json})"
end
end
You can’t perform that action at this time.