and of course
Wednesday, February 22, 2012
Monday, February 20, 2012
Ruby (and rails)
So I've decided to learn Ruby and Rails. Just some links I've found useful in getting started.
Of course there is all the *nix/win32 env install crap, rvm seems to be THE choice, and since I'm using linux, it's easy enough.
Good entry point for a web developer.
A cross platform textmate like editor that may be worth looking into.
Further reading
Neat for the lazy learner. Threads are short here but interesting.
Comming with considerable php experience this was nice to see how CGI has been plugged into Ruby (Ruby->Rack->Rails)
more to come ...
Sunday, February 19, 2012
Bash string replace
I was using sed for template substitution recently and it seemed that no matter what regex delimiter I chose, that char existed in the template and caused my template population (sed replace) to fail. Fortunately bash has string substitution built right in, albeit with some slightly strange syntax.
# replace all @ chars with \@
x=${x//@/\\@}
now we can freely sub in values for our template variables w/o having to worry if they contain @ characters
#$1 = file name
#$2 = template variable name
sed -i s@$2@$x@g templates/$1
Subscribe to:
Posts (Atom)