Skip to content

Instantly share code, notes, and snippets.

@febeling
febeling / stacktrace.hrl
Created March 19, 2009 13:40
Macros for displaying stacktrace information in erlang
-define(callstack(),
try throw(generate_stack)
catch
throw:generate_stack ->
erlang:get_stacktrace()
end).
-define(printstack(),
PrintFrame = fun({Mod, Fun, Ari}) ->
io:format(" at ~w:~w/~w~n", [Mod, Fun, Ari])
@febeling
febeling / g
Created February 17, 2009 21:08
Google from the shell for Mac OS X
#!/bin/sh
# -*- shell-script -*-
query=""
for term in $@
do
if [[ $query ]] ; then
query+="+$term"
else
query=$term
fi
@febeling
febeling / com.florianebeling.rubygems.server.plist
Created December 8, 2008 20:20
Run gem server in background on OS X. save as FILE, then do "launchctl load FILE". Symlink FILE to /Library/LaunchDaemons to get it started automatically on restart
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.florianebeling.rubygems.server</string>
<key>ProgramArguments</key>
<array>
<string>/opt/local/bin/ruby</string>
<string>/opt/local/bin/gem</string>