Category: Programming
-
Curry in Ruby
Inspired by some currying examples in scheme, I wanted to try them in Ruby… def seq(oldfirst, keepold) lambda do |new, old, item, list| list.push(new) if old==item and !oldfirst list.push(item) if keepold or old != item list.push(new) if oldfirst and old==item end end def insertF(new, old, list, func) temp = [] list.each do |item| func.call new, […]
-
Startup Scripts on OS X
I have a set number of programs that I usually want to start when my macbook pro boots up. But sometimes I want to boot in a hurry and all the startup items bother me. I came up with a solution I thought I’d pass on. I load Aquamacs automatically, as I use it for […]
-
SVN Repository fix
I was fixing several subversion repositories. I didn’t have the standard branches, tags, trunk structure set up. Here’s a script to help with that. Use it like… sh ~/.svn-fix.sh https://mysvnserver.net/svn/hello-project trunk #!/bin/bash $repo=”$1″ $dest=”$2″ entries=`svn list $repo | grep -v $dest` svn mkdir $repo/$dest for d in $entries do svn move $repo/$d $repo/$dest/ -m “moved […]