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
screen -X eval 'hardstatus alwayslastline "%{r}[%{w}%n%{r}]"' # this sets the hardstatus to [0], where 0 is the number of window |
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
require 'rubygems' | |
require 'prowly' | |
Prowly.notify do |n| | |
n.apikey = "your_apikey_here" | |
n.priority = Prowly::Notification::Priority::MODERATE | |
n.application = "My Site" | |
n.event = "Alert" | |
n.description = "Something went wrong!" | |
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
require 'rubygems' | |
require 'active_record' | |
require 'active_record/schema_dumper' | |
ActiveRecord::Base.establish_connection( | |
:adapter => "mysql", | |
:host => "localhost", | |
:username => "root", | |
:password => "pwd", | |
:database => "test" |
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 Foo | |
def splat(bar, baz) | |
[bar, baz] | |
end | |
end | |
class Bar < Foo | |
def splat(*) | |
#do whatever you want here, like logging, etc | |
super |
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
#to use with the MUSh gem's bitly command | |
function bl() { | |
response=`bitly $1` | |
if [[ $response == *http://* ]]; then | |
echo $response | pbcopy | |
return 0 | |
fi | |
echo $response | |
} |
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
config.after_initialize do | |
[User, And, All, The, Models, You, Want].each do |model| | |
model.class_eval do | |
include FakeActiveRecord3Methods | |
end | |
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
$ autotest | |
(Not running features. To run features in autotest, set AUTOFEATURE=true.) | |
(Not running features. To run features in autotest, set AUTOFEATURE=true.) | |
(Not running features. To run features in autotest, set AUTOFEATURE=true.) | |
loading autotest/rspec2 | |
style: Rspec2 | |
bundle exec /opt/local/bin/ruby -rrubygems -e "require 'redgreen'" -S /opt/local/lib/ruby/gems/1.8/gems/rspec-core-2.0.1/bin/rspec --autotest '/Users/raf/projects/_own/ruby/dooby/spec/task_spec.rb' '/Users/raf/projects/_own/ruby/dooby/spec/dooby_module_spec.rb' '/Users/raf/projects/_own/ruby/dooby/spec/list_spec.rb' | |
-e:1:in `require': no such file to load -- redgreen (LoadError) | |
from -e:1 |
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
require 'benchmark' | |
class Dummy | |
@VALID_OPTIONS = :first, :last, :all | |
class << self | |
def when_find(*args) | |
case args.first | |
when *@VALID_OPTIONS |
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
God.contact(:prowl) do |c| | |
c.name = 'your name' | |
c.apikey = 'your prowl api' | |
c.group = 'developers' | |
end | |
God.contact(:prowl) do |c| | |
c.name = 'another name' | |
c.apikey = 'another prowl api' | |
c.group = 'developers' |
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
function aliaz | |
{ | |
if [ -n "$1" ] | |
then | |
read COMMAND ALIAS <<<$(IFS="="; echo $1) | |
if command -v $COMMAND > /dev/null 2>&1 | |
then | |
echo "The command or alias '$COMMAND' already exists!" | |
else | |
alias $1 |
OlderNewer