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
{ | |
browser : 'Chrome', | |
mail : 'Sparrow', | |
calendar : 'iCal', | |
twitter : 'Twitter.app', | |
campfire : 'Propane', | |
contacts : 'Cobook', | |
terminal : 'iTerm2', | |
editor : 'vim', | |
notes : 'Evernote', |
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
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence | |
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users | |
if exists('$TMUX') | |
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\" | |
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\" | |
else | |
let &t_SI = "\<Esc>]50;CursorShape=1\x7" | |
let &t_EI = "\<Esc>]50;CursorShape=0\x7" | |
endif |
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 Hello | |
def self.first | |
puts "Boo!" | |
end | |
private | |
def self.second | |
puts "Buh!" | |
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
call pathogen#infect() | |
syntax on | |
filetype plugin indent on |
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
. | |
├── autoload | |
│ ├── pathogen.vim | |
│ └── pathogen.vim.old | |
├── backup | |
├── bundle | |
│ ├── nerdcommenter | |
│ ├── scss-syntax.vim | |
│ ├── snipmate.vim | |
│ ├── supertab |
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
/* this is a function */ | |
main() | |
{ | |
/* this is a statement */ | |
printf("This C stuff is easy!\n"); | |
/* so is this */ | |
return 0; | |
} |
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 'spec_helper' | |
describe "daemons/index.html.erb", :type => :request do | |
before :each do | |
assign( :daemons, { 'test' => :up } ) | |
render | |
end | |
it "has the correct class" do | |
rendered.should have_css('table tr td.daemon-up') |
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
# This is a basic implementation and is essentially what Rory had. | |
# I just had to prove to myself that it worked. ;) | |
# Decorator pattern is precisely the way to go here. | |
# This is the base class that we want to decorate. | |
# It needs to have a default method for each of the lifecycle events. | |
# i.e. what does it do in the event that there are no products. | |
class Post | |
attr_accessor :products, :featured, :hidden |
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 ENV['RAILS_ENV'] | |
# Called after the irb session is initialized and Rails has been loaded | |
IRB.conf[:IRB_RC] = Proc.new do | |
#logger = Logger.new(STDOUT) | |
#ActiveRecord::Base.logger = logger | |
#ActiveRecord::Base.connection_pool.clear_reloadable_connections! | |
show_log | |
end | |
def show_log |
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
# Example of potential Template pattern implementation: - | |
class Animal | |
def initialize(name, type) | |
@name = name | |
@type = type | |
end | |
def mammal? | |
@type == "mammal" |