Skip to content

Instantly share code, notes, and snippets.

View gdetrez's full-sized avatar
🏠
Working from home

Grégoire Détrez gdetrez

🏠
Working from home
  • Gothenburg, Sweden
View GitHub Profile
@gdetrez
gdetrez / watch.mk
Created June 27, 2013 15:25
Poor man's guard: a simple, one line, watch function. For Makefiles or shell scripts.
watch = while true; do (inotifywait -qre close_write --format "%w%f" . | grep $1) && $2; done
all:
$(call watch, 'test/.*.txt', echo "some stuff has changed...")
@gdetrez
gdetrez / powerline-test.sh
Last active November 19, 2023 04:07
Powerine font test
#!/bin/bash
echo -e "Powerline glyphs:\n\
Code points Glyphe Description Old code point
U+E0A0 \xee\x82\xa0 Version control branch (U+2B60 \xe2\xad\xa0 )\n\
U+E0A1 \xee\x82\xa1 LN (line) symbol (U+2B61 \xe2\xad\xa1 )\n\
U+E0A2 \xee\x82\xa2 Closed padlock (U+2B64 \xe2\xad\xa4 )\n\
U+E0B0 \xee\x82\xb0 Rightwards black arrowhead (U+2B80 \xe2\xae\x80 )\n\
U+E0B1 \xee\x82\xb1 Rightwards arrowhead (U+2B81 \xe2\xae\x81 )\n\
U+E0B2 \xee\x82\xb2 Leftwards black arrowhead (U+2B82 \xe2\xae\x82 )\n\
@gdetrez
gdetrez / notes.md
Created June 20, 2013 08:21
Ruby dependency hell
@gdetrez
gdetrez / gist:5245991
Last active December 15, 2015 10:29
BNFC quick testing routine
# linux
cd `mktemp -d`
wget http://bnfc.digitalgrammars.com/download/bnfc-2.5.0rc1-linux.gz # Change me!
gzip -d bnfc-*.gz
chmod +x bnfc-*
wget https://raw.github.com/BNFC/bnfc/master/examples/Calc.cf
./bnfc-* -m Calc.cf
make
echo "2+3*4" | ./TestCalc
class Main {
public static void main(String[] argv) {
Arme epee = new Arme(10, "Magic epee");
Arme fusil = new Arme(30, "fusil");
System.out.print("J'ai une ");
System.out.print(epee.name);
System.out.print(" de force ");
System.out.println(epee.force);