Skip to content

Instantly share code, notes, and snippets.

View oc's full-sized avatar

Ole Christian Rynning oc

  • UPPERCASE
  • Oslo, Norway
View GitHub Profile
gn() {
cmd=Command
test $# -gt 0 && cmd=$@
eval $cmd
growlnotify -n Shell -m "exited with $?" "$cmd"
}
@oc
oc / gist:186037
Created September 13, 2009 01:19
desc "Update Scala's I18N Language traits with file = /path/to/lib/cucumber/languages.yml"
task :update_scala_i18n, :file do |t, args|
# Limitations: Will only choose first variant of translation and will CamelCase multiple words
def e(str); str.gsub(/([\\'])|(\|.*)/, '').split(/[- _?()]/).map {|w| w.capitalize}.join; end
# Parse Cucumber language.yml and write the (new) Languages.scala file
out = File.new("cuke4duke/src/main/scala/cuke4duke/Languages.scala", "w")
out << "package cuke4duke\n"
YAML.load_file(args.file).each do |key, lang|
trait = [e(lang['name']), e(lang['given']), e(lang['when']), e(lang['then'])]
# Avoid duplicate definitions of same keyword (see:Uzbek) and already defined English keywords
gn() {
cmd=Command
test $# -gt 0 && cmd=$@
eval $cmd
growlnotify -n Shell -m "exited with $?" "$cmd"
}
#$ gn somecommand --with-args=true yes
#=> somecommand --with-args=true yes
#=> exited with 127
#!/bin/bash
if [ $UID = 0 ]
then
script=$0
test -f $script || script=$(pwd)/$(basename $0)
/usr/bin/sudo -u oc -H $script "$*"
exit
fi
~/dev/SMIDIG/smidig2009:> rake deploy:experimental --trace
(in /Users/oc/dev/SMIDIG/smidig2009)
** Invoke deploy:experimental (first_time)
** Invoke deploy:experimental:update (first_time)
** Execute deploy:experimental:update
[[email protected]] Logging in
Password:
[[email protected]] svn up --revision HEAD /home/smidig_no/apps/smidig2009/experimental/smidig2009
At revision 68.
[[email protected]] rake gems:unpack