View git-bump.rb
#!/usr/bin/env ruby | |
require 'git' | |
require 'logger' | |
g = Git.open(Dir.pwd) | |
if ARGV.include?("-h") || ARGV.include?("--help") | |
puts <<-EOF | |
USAGE: git bump [options] |
View gist:48c0cf022fa0ca610e12
set_color() { | |
local HEX_FG=$1 | |
local HEX_BG=$2 | |
local OPACITY=$3 | |
local FG_R=`echo $HEX_FG | sed 's/../0x&,/g' | awk -F "," '{printf("%d",$1 * 257)}'` | |
local FG_G=`echo $HEX_FG | sed 's/../0x&,/g' | awk -F "," '{printf("%d",$2 * 257)}'` | |
local FG_B=`echo $HEX_FG | sed 's/../0x&,/g' | awk -F "," '{printf("%d",$3 * 257)}'` | |
local BG_R=`echo $HEX_BG | sed 's/../0x&,/g' | awk -F "," '{printf("%d",$1 * 257)}'` | |
local BG_G=`echo $HEX_BG | sed 's/../0x&,/g' | awk -F "," '{printf("%d",$2 * 257)}'` |
View pivotal.rb
require 'rubygems' | |
require 'mail' | |
require 'pivotal_tracker' | |
require 'git' | |
class Pivotal | |
attr_reader :story, :project |
View development.log
SQL (0.1ms) BEGIN | |
Issue Load (0.1ms) SELECT `issues`.* FROM `issues` WHERE (`issues`.`resolution` IS NULL) AND (`issues`.`description` = '') AND (`issues`.`name` = 'something') ORDER BY start_at DESC LIMIT 1 | |
SQL (0.2ms) SELECT COUNT(*) AS count_id FROM `comments` | |
SQL (18.6ms) INSERT INTO `comments` (`body`, `commentable_id`, `commentable_type`, `created_at`, `updated_at`, `user_id`) VALUES ('Duplicate attempted to open', 3370, 'Issue', '2010-11-03 14:36:12', '2010-11-03 14:36:12', 1) | |
SQL (47.5ms) ROLLBACK |
View operating_system.rb
class OperatingSystem < ActiveRecord::Base | |
belongs_to :host | |
def self.search(term) | |
t = OperatingSystem.arel_table | |
match_on = [:name,:version,:service_pack] | |
matches = match_on.map {|m| "IF(#{t[m].matches("%#{term}%").to_sql},operating_systems.#{m.to_s},NULL)" } | |
matching_string = "CONCAT_WS(' ', #{matches.join(",")}) as matched_on" |
View host.rb
class Host < ActiveRecord::Base | |
has_one :operating_system | |
attr_accessor :matched_on | |
end |
View session_store.rb
Rails.application.config.session_store :cookie_store, { | |
:domain => '.rails.local', | |
:key => '_sso_session' | |
} | |
Rails.application.config.secret_token = 'the same really long hex string' |
View session_store.rb
Rails.application.config.session_store :cookie_store, { | |
:domain => '.rails.local', | |
:key => '_sso_session', | |
:secret => 'the same really long hex string' | |
} |
View development.rb
config.action_controller.session = { | |
:domain => ".rails.local" | |
} |
NewerOlder