Skip to content

Instantly share code, notes, and snippets.

View amikula's full-sized avatar

Alf Mikula amikula

View GitHub Profile
@amikula
amikula / What I typed on twitter web
Created January 6, 2012 18:49
Bad, bad Twitter!
Ugh. Twitter "shortens" laruby.com (laruby dot com) to http://t.co/JcCpu8I2. Bad Twitter!
@amikula
amikula / gist:744114
Created December 16, 2010 22:21
Stack level too deep?
#!/usr/bin/env ruby
def foo
bar
end
def bar
bar
end
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
en:
hello: "Hello world"
array:
- foo
- bar
- baz
boolean: true
@amikula
amikula / environment.plist
Created September 16, 2009 16:27
Put this file into ~/.MacOSX/environment.plist and logout/login to add your macports bin directory to the path for the hangman Ruby Sparring environment.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>PATH</key>
<string>/opt/local/bin:/bin:/sbin:/usr/bin:/usr/sbin</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>PATH</key>
<string>/opt/local/bin:/bin:/sbin:/usr/bin:/usr/sbin</string>
</dict>
</plist>
@amikula
amikula / gist:112494
Created May 15, 2009 23:36 — forked from halbtuerke/gist:31934
Zsh translation
autoload -U colors
colors
setopt prompt_subst
parse_git_branch() {
local state remote
git rev-parse --git-dir &> /dev/null
git_status="$(git status 2> /dev/null)"
branch_pattern="# On branch ([[:alnum:]/]*)"
# Module for re-running commands from the history in irb and its ilk (script/console)
# Usage:
# history => view the history
# history 7 => rerun line 7 in the history
# history /foo/ => rerun the last line in the history matching /foo/
#
# Just add this code into your ~/.irbrc.
# NOTE: Readline support is required for this to work.
module HistoryRepeats
class << self
" <K>ill trailing <W>hitespace
nnoremap <leader>kw :1,$s/ \+$//<CR>
vnoremap <leader>kw :s/ \+$//<CR>