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
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);
@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
@gdetrez
gdetrez / notes.md
Created June 20, 2013 08:21
Ruby dependency hell
@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 / 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...")
This file has been truncated, but you can view the full file.
<changelog>
<patch author='hallgren@chalmers.se' date='20130725160443' local_date='Thu Jul 25 18:04:43 CEST 2013' inverted='False' hash='20130725160443-bae10-902fdf62b1c1e616ae0dfc7ccf6e502db6a1fd80'>
<name>Allow cross origin requests to GF cloud &amp; PGF services</name>
<comment>Ignore-this: bc3cf05fa68c6cc1670b66fa7613d2d9
By adding a header
Access-Control-Allow-Origin: *
to the HTTP responses, web browsers are informed that it is OK to call the
services from web pages hosted on other sites.
@gdetrez
gdetrez / aaaostneuhnt.gf
Created August 20, 2013 12:56
test for gface
abstract abcd = {}
abstract A = { cat S ; }
@gdetrez
gdetrez / data.xml
Last active December 31, 2015 15:59
<?xml version="1.0" encoding="UTF-8"?>
<A a1="A1">
<B b1="B1" b2="15">
<C c1="red">first</C>
</B>
<B b1="B2">
<C c1="green">second</C>
</B>
<B b1="B3" b2="25">
<C c1="blue">third</C>
CREATE OR REPLACE TRIGGER BidHighEnough
BEFORE INSERT ON Bids
REFERENCING NEW AS new
FOR EACH ROW
DECLARE numHigherBids INT;
BEGIN
SELECT COUNT(amount) INTO numHigherBids
FROM Bids
WHERE item = :new.item AND amount > :new.amount;