Skip to content

Instantly share code, notes, and snippets.

@magnusstahre
magnusstahre / .gitattributes
Created August 27, 2011 15:29
Displaying xmind files as text in git diff,blame,show etc.
*.xmind diff=xmind
@magnusstahre
magnusstahre / powernap
Created August 28, 2011 14:43
Tells OS X to sleep from command line
#!/usr/bin/env osascript
tell application "System Events" to sleep
@magnusstahre
magnusstahre / about.md
Created September 5, 2011 04:49 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@magnusstahre
magnusstahre / rot13.rb
Created September 17, 2011 17:43 — forked from rdammkoehler/rot13.rb
Teaching my 10yr old daughter about ROT-13
class String
def rot13
tr 'abcdefghijklmnopqrstuvwxyz', 'nopqrstuvwxyzabcdefghijklm'
end
end
describe 'String#rot13' do
let (:message) { "the quick brown fox jumps over the lazy dog" }
let (:encoded) { "gur dhvpx oebja sbk whzcf bire gur ynml qbt" }
@magnusstahre
magnusstahre / .screenrc
Created January 29, 2012 17:13
My .screenrc and .tmux.conf
escape ^Z^Z
bind z suspend
bind ^a other
def good_or_bad lines, patterns
lines.zip(patterns).all? { |(line, pattern)|
line.match pattern
}
end
lines = [ "line1", "line2", "line3" ]
patterns = [ "pattern1", "pattern2", "pattern3" ]
puts lines.zip patterns #=> [["line1", "pattern1"], ["line2", "pattern2"], ["line3", "pattern3"]] 
good_or_bad lines, patterns #=> false
@magnusstahre
magnusstahre / post-checkout
Created November 6, 2012 04:48 — forked from jasonkarns/post-checkout
Post Checkout git hook to remind me about running certain commands when appropriate files have been modified
#!/bin/sh
if ! git diff-tree --quiet $1 $2 -- Gemfile
then
echo "\nGemfile modified: run \`bundle install\`\n"
fi
if ! git diff-tree --quiet $1 $2 -- db/migrate db/schema.rb db/structure.sql
then
echo "\nSchema modified: run \'rake db:migrate\'\n"
fi
@magnusstahre
magnusstahre / resources.txt
Created November 17, 2012 16:28
git resources
http://gitimmersion.com/
http://try.github.com/
http://www.codeschool.com/courses/try-git
http://git-scm.com/book

Greetings and Welcome Explorer,

I am glad that you found your way here. You deserve better than another routine day of drudgery aboard the Stellar Patrol Ship Feinstein. I think we want to work with you.

Detroit Labs is in the business of creating mobile apps. We do this by inviting the best and most interesting people to join our team, and asking them to solve the hard problems that go along with building and shipping software. Since you are reading this, you may be one of those people. I hope so!