This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ISP_FALLBACK=no | |
STARTUP_LAPSE=120 | |
# PPTP settings | |
# Remote Subnet: 0.0.0.0 | |
# Remote Subnet Mask: 255.255.255.0 | |
# MPPE Encryption (note the space is not typo): mppe required,no40,no56,stateless | |
# MTU (use default): 1450 | |
# MRU (use default): 1450 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$(acpi -a | awk '{print $3}' | tr [a-z] [A-Z])" == "ON-LINE" ]; then | |
if [ "$(acpi -b | awk '{print $4}')" == "100%" ]; then | |
echo -n "100%" | |
else | |
echo -n "$( | |
acpi -b | \ | |
awk '{gsub(",",""); print $4 "(+" $5}' | \ | |
awk -F: '{print $1 ":" $2 ")"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gemset=mayday | |
old_ruby=ruby-1.9.3-p0 | |
new_ruby=ruby-1.9.3-p0-perf | |
# Get 30% boast for rails boot, see https://gist.github.com/1688857 | |
export RUBY_HEAP_MIN_SLOTS=1000000 | |
export RUBY_HEAP_SLOTS_INCREMENT=1000000 | |
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 | |
export RUBY_GC_MALLOC_LIMIT=1000000000 | |
export RUBY_HEAP_FREE_MIN=500000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Have u ever found urself doing this: | |
class Thing | |
def size=(size) | |
@size = size | |
end | |
def size | |
@size | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# features/support/cucumber_fuubar_patch.rb | |
module Cucumber::Cli::Configuration::Patch | |
def self.included(base) | |
base.class_eval do | |
alias_method :_orig_formatter_class, :formatter_class | |
def formatter_class(format) | |
if format == 'Cucumber::Formatter::Fuubar' | |
require 'cucumber/formatter/fuubar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'RMagick' | |
require 'capybara' | |
require 'capybara/dsl' | |
# ================================================================ | |
# Collect input args | |
# ================================================================ | |
begin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if Rails.env.test? | |
ActionDispatch::Callbacks.before do | |
CrossStub.refresh :file => Rails.root.join('tmp', 'crossstub.cache') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/ty.archlinux/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 23, col -1: ` ' :cd': "\E[J:ce=\E[K:cl=\E[H\E[J:cm=\E[%i%d;%dH:ct=\E[3g:\" (ArgumentError) | |
' :do': "^J:nd=\E[C:pt:rc=\E8:rs=\Ec:sc=\E7:st=\EH:up=\EM:\" | |
' :le': "^H:bl=^G:cr=^M:it#8:ho=\E[H:nw=\EE:ta=^I:is=\E)0:\" | |
' :li#33:co#127:am:xn:xv:LP:sr': "\EM:al=\E[L:AL=\E[%dL:\" | |
' :cs': "\E[%i%d;%dr:dl=\E[M:DL=\E[%dM:im=\E[4h:ei=\E[4l:mi:\" | |
' :IC': "\E[%d@:ks=\E[?1h\E=:ke=\E[?1l\E>:vi=\E[?25l:\" | |
' :ve': "\E[34h\E[?25h:vs=\E[34l:ti=\E[?1049h:te=\E[?1049l:\" | |
' :us': "\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:mb=\E[5m:\" | |
' :md': "\E[1m:mr=\E[7m:me=\E[m:ms:\" | |
' :Co#8:pa#64:AF': "\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TweetObserver < ActiveRecord::Observer | |
observe :post, :implementation, :question | |
def after_create(model) | |
tweet(model.tweet_title, model.tweet_path) | |
end | |
private | |
def tweet(title, path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usages: | |
# | |
# 1. Obtain benchmark results by repeating :spec by running the default number (5) of times | |
# $ rake benchmark[spec] | |
# | |
# 2. Obtain benchmark results by repeating :spec by running it 2 times | |
# $ rake benchmark[spec,2] | |
# | |
task :benchmark, :task, :times do |t, args| | |
times, task = (args.times || 5).to_i.method(:times), args.task |
NewerOlder