- partial fix: add this to your user keybindings (this only works between files, not within a file)
[
{ "keys": ["ctrl+o"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+i"], "command": "prev_view_in_stack" }
]
find . -type f -name \*.rb -exec grep -qi "foo" {} \; -print |xargs sed -i "" -e "s|foo|bar|g" -e "s|Foo|Bar|g" |
git grep 'thing_to_search_for' | grep spec | grep -v vendor | grep rb: | awk '{print $1}' | sed -e 's/.$//' | uniq | xargs spec |
curl http://url-to-hudson-log | grep -A 5 'Failing Scenarios' | grep ^cucumber | awk '{print $2}' | sed -e 's/^.*\(\/features.*\)$/\1/' | sed -e 's/^.//' | xargs script/cucumber |
(defn recursive-reverse [coll] | |
(if (= 0 (count coll)) | |
[] | |
(concat (recursive-reverse (drop 1 coll)) (take 1 coll)))) | |
(defn recursive-reverse [coll] | |
(loop [coll coll | |
acc []] | |
(if (empty? coll) | |
acc |
Ok, so I'm trying to replace a ' character with \' in a ruby string. I have working code, but it was | |
*way* too painful getting there for my taste. | |
Take a look: | |
ree-1.8.7-2010.02 :001 > single_quote = "\'" | |
=> "'" | |
ree-1.8.7-2010.02 :003 > single_quote.gsub(/'/, "\\\'") | |
=> "" | |
ree-1.8.7-2010.02 :004 > single_quote.gsub(/'/) {|c| "\\'"} |
#!/bin/bash | |
set -e | |
for file in `curl -s https://www.destroyallsoftware.com/screencasts/catalog | | |
grep screencasts | | |
tail -n +6 | | |
grep '(' | | |
cut -d '"' -f 2`; do | |
filename=$(echo $file | cut -d '/' -f 4) |
class Foo | |
Object = nil | |
def getBinding() | |
binding() | |
end | |
end | |
Foo::Object #returns nil | |
Object #returns Object |
#foo.rb | |
class Foo < Bar | |
end | |
#bar.rb | |
class Bar < ActiveRecord::Base | |
#all sorts of crazy code that depends on a bunch of wacky stuff my tests don't care about | |
end |
git branch -r | grep kbaribeau | grep -v ${stuff_to_keep} | cut -d '/' -f 2-9 | sed -e 's/^/:/' | xargs git push origin |