Skip to content

Instantly share code, notes, and snippets.

View ammojamo's full-sized avatar

James Watmuff ammojamo

  • Planticle
  • Adelaide, Australia
View GitHub Profile
@ammojamo
ammojamo / mvn-all.sh
Created December 20, 2010 04:54
Run maven in a list of directories, passing arguments and failing fast
#!/bin/sh
parent=$(pwd)
for dir in proj1 \
proj2 \
proj3
do
pushd $dir && mvn $@ | tee $parent/mvn-out && expr $PIPESTATUS = 0 && popd || break
done
osascript -e 'tell app "System Events" to activate'
@ammojamo
ammojamo / glist_iterator.c
Created July 16, 2009 06:09
Iterator interface for glib GList
/* Simple iterator implementation for iterating over GLists and removing */
/* elements during iteration. */
typedef GList *GIterator;
static inline GIterator *g_iter(GList **list) {
return list;
}
static inline GList *g_iter_current(GIterator *iterator) {
return *iterator;