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
function! s:join(cmd) | |
if exists(':SplitjoinJoin') && !v:count | |
let tick = b:changedtick | |
SplitjoinJoin | |
if tick == b:changedtick | |
execute 'normal! '.a:cmd | |
endif | |
else | |
execute 'normal! '.v:count.a:cmd | |
endif |
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 config/overrides/*.yml to .gitignore | |
# and this near the top of application.rb | |
%w(defaults overrides).each do |type| | |
path = File.expand_path("../#{type}/#{Rails.env}.yml", __FILE__) | |
ENV.update(YAML.load_file(path)) if File.exist?(path) | |
end | |
# For things that are sensitive or developer dependent: | |
# config/overrides/{development,test}.yml | |
# For everything else: |
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
Sprockets::Helpers::RailsHelper::AssetPaths.class_eval do | |
class MissingAssetError < StandardError; end | |
def digest_for_with_presence_check(logical_path) | |
unless asset_environment[logical_path] | |
raise MissingAssetError.new("#{logical_path} doesn't exist") | |
end | |
digest_for_without_presence_check(logical_path) | |
end | |
alias_method_chain :digest_for, :presence_check |
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
" Place in ~/.vim/after/plugin/speeddating.vim | |
" In Vim, -4 % 3 == -1. Let's return 2 instead. | |
function! s:mod(a,b) | |
if (a:a < 0 && a:b > 0 || a:a > 0 && a:b < 0) && a:a % a:b != 0 | |
return (a:a % a:b) + a:b | |
else | |
return a:a % a:b | |
endif | |
endfunction |
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
/* vim: set ft=c sw=4 et: */ | |
{ | |
"^u" = "deleteToBeginningOfParagraph:"; | |
"^v" = "pageDown:"; | |
"^w" = "deleteWordBackward:"; | |
"~/" = "complete:"; | |
"~<" = "moveToBeginningOfDocument:"; | |
"~>" = "moveToEndOfDocument:"; | |
"~b" = "moveWordBackward:"; | |
"~d" = "deleteWordForward:"; |
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
targets=( ${${(f)"$(_call_program targets $words[1] -sT $opt_args[(I)(-N|--nosearch)] ${(kv)opt_args[(I)(-f|--rakefile)]} 2>/dev/null)"}/(#b)rake ([^ ]##) ##\# (*)/${${match[1]}//:/\\:}:${match[2]:l}} ) |
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
set keymap vi-insert | |
Control-a: beginning-of-line | |
Control-b: backward-char | |
Control-d: delete-char | |
Control-e: end-of-line | |
Control-f: forward-char | |
Control-k: kill-line | |
Control-n: next-history | |
Control-p: previous-history | |
set keymap emacs-ctlx |
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
ids = (1..1_000_000).to_a; nil | |
x = rand(1_000_000) | |
Benchmark.realtime do | |
the_set = ids.to_set | |
1000.times do | |
the_set.include?(x) | |
end | |
end | |
# => 0.7543990612030029 |
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
#compdef gem gem1.9 | |
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]" | |
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]" | |
"(-q --quiet)"{-q,--quiet}"[Silence commands]" | |
"--config-file[Use this config file instead of default]:file:_files" | |
"--backtrace[Show stack backtrace on errors]" | |
"--debug[Turn on Ruby debugging]" | |
$nul_arg | |
) |
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
+__rvm_parse_args:727> [[ -n 4.3.10 ]] | |
+__rvm_parse_args:750> [[ -z '' && -n '' ]] | |
+__rvm_parse_args:752> [[ 0 -eq 1 || -n '' ]] | |
+__rvm_parse_args:20> [[ -n use ]] | |
+__rvm_parse_args:22> rvm_token=use | |
+__rvm_parse_args:24> (( 1 > 0 )) | |
+__rvm_parse_args:26> next_token=1.9.3-preview1@unknown | |
+__rvm_parse_args:27> shift | |
+__rvm_parse_args:32> case use ([[:alnum:]]*|@*) | |
+__rvm_parse_args:36> case use (use) |