If you can keep your head when all about you
Are losing theirs and blaming it on you,
If you can trust yourself when all men doubt you
But make allowance for their doubting too,
If you can wait and not be tired by waiting,
Or being lied about, don't deal in lies,
Or being hated, don't give way to hating,
And yet don't look too good, nor talk too wise:
This file contains hidden or 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
" Whenever you execute an `:edit somefile` command with the cursor in the | |
" NERDTree, the file gets edited in the NERDTree buffer, which is usually not | |
" something you want. This autocommand attempts to edit the given file in the | |
" closest non-NERDTree buffer instead. | |
" | |
" It's fairly hacky, but seems to work. I'll probably use it myself, so I'll | |
" try to remember to update it if I find any problems. | |
augroup AvoidEditingNERDTree | |
autocmd! |
This file contains hidden or 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 'rails/console/app' | |
ActiveSupport::Notifications.subscribe /^sql\./ do |*args| | |
puts caller.grep(%r[/garmz/]) { |line| " #{line.gsub(/.*?\/garmz\//, '')}" }.take(3) * "\n" | |
end | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
app.get '/newsfeed' | |
ActiveRecord::Base.logger = Logger.new(nil) |
This file contains hidden or 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
# add this to your spec helper | |
RSpec.configure do |config| | |
config.treat_symbols_as_metadata_keys_with_true_values = true | |
config.filter_run :focus => true | |
config.run_all_when_everything_filtered = true | |
end | |
# and then use the :focus tag in your specs | |
it "does something awesome", :focus do |
This file contains hidden or 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
README.ext | |
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_6/README.EXT?revision=12055 | |
Extending Ruby - Pickaxe | |
http://ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html | |
Extending Ruby on O'Reilly | |
http://onlamp.com/pub/a/onlamp/2004/11/18/extending_ruby.html | |
Ruby C Extensions - Mark Volkman |
This file contains hidden or 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
/* `XHTML, HTML4, HTML5 Reset | |
----------------------------------------------------------------------------------------------------*/ | |
a, | |
abbr, | |
acronym, | |
address, | |
applet, | |
article, | |
aside, |
This file contains hidden or 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
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a | |
function! s:align() | |
let p = '^\s*|\s.*\s|\s*$' | |
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p) | |
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g')) | |
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*')) | |
Tabularize/|/l1 | |
normal! 0 | |
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.')) |
This file contains hidden or 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
" Requires: Utl | |
call NERDTreeAddKeyMap({ | |
\ 'key': 'gu', | |
\ 'callback': 'OpenCurrentNodeWithUtl', | |
\ 'quickhelpText': 'open current node with the Utl plugin' }) | |
function! OpenCurrentNodeWithUtl() | |
" Get the path of the item under the cursor if possible: | |
let currentDir = g:NERDTreeFileNode.GetSelected() |
This file contains hidden or 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 | |
# | |
# Git commit-msg hook. If your branch name is in the form "t123", automatically | |
# adds "Refs #123." to commit messages unless they mention "#123" already. | |
# Include "#close" or "#finish" to add "Closes #123." | |
# | |
# For Pivotal Tracker, branch names like "s123" adds "[#123]". | |
# Include "#close" or "#finish" to add "[Finishes #123]". | |
# | |
# If you include "#noref" in the commit message, nothing will be added to |