Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am c2nes on github.
  • I am cthunes (https://keybase.io/cthunes) on keybase.
  • I have a public key whose fingerprint is BBB1 DA15 B35F EA76 406B EE6C BFB7 1AB9 0223 A924

To claim this, I am signing this object:

// loop until tripped, broken, interrupted, or timed out
for (;;) {
try {
if (!timed)
trip.await();
else if (nanos > 0L)
nanos = trip.awaitNanos(nanos);
} catch (InterruptedException ie) {
if (g == generation && ! g.broken) {
@c2nes
c2nes / xbindkeysrc
Created November 8, 2012 18:20
xbindkeys config file
# For the benefit of emacs users: -*- shell-script -*-
###########################
# xbindkeys configuration #
###########################
# Examples of commands:
"cterm"
alt + shift + Return
@c2nes
c2nes / rc.xml
Created November 8, 2012 18:12
Openbox rc.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Do not edit this file, it will be overwritten on install.
Copy the file to $HOME/.config/openbox/ instead. -->
<openbox_config xmlns="http://openbox.org/3.4/rc">
<resistance>
<strength>20</strength>
<screen_edge_strength>20</screen_edge_strength>
</resistance>
<focus>
<focusNew>yes</focusNew>
@c2nes
c2nes / breakjavac.sh
Created September 30, 2012 16:36
Generates a Test.java file that causes a stack overflow exception when compiled with javac
(
echo 'public class Test {'
echo ' public void test() {'
echo -n ' int n = '
for i in {0..10000}; do
echo -n '(';
done;
echo -n 1;
@c2nes
c2nes / javacparser.txt
Created September 29, 2012 19:07
JavacParser.java AST
This file has been truncated, but you can view the full file.
CompilationUnit[package] {'name': u'com.sun.tools.javac.parser'}
CompilationUnit[imports[0]] {'path': u'java.util'}
CompilationUnit[imports[1]] {'path': u'com.sun.tools.javac.tree'}
CompilationUnit[imports[2]] {'path': u'com.sun.tools.javac.code'}
CompilationUnit[imports[3]] {'path': u'com.sun.tools.javac.util'}
CompilationUnit[imports[4]] {'path': u'com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag'}
CompilationUnit[imports[5]] {'path': u'com.sun.tools.javac.util.List'}
CompilationUnit[imports[6]] {'path': u'com.sun.tools.javac.util.ListBuffer.lb'}
CompilationUnit[imports[7]] {'path': u'com.sun.tools.javac.tree.JCTree'}
diff --git a/src/Makefile b/src/Makefile
index 46fa431..9a9166d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,7 +16,7 @@ OBJ = $(SRC:.c=.o)
all: $(LIB_FILE)
$(LIB_FILE): $(OBJ)
- $(CC) $(LDFLAGS) $(LIB_LDFLAGS) $(OBJ) -o $(LIB_FILE)
+ $(CC) $(OBJ) -o $(LIB_FILE) $(LIB_LDFLAGS) $(LDFLAGS)
@c2nes
c2nes / java_grammar.txt
Created September 18, 2012 14:26
Java grammar extracted from JavacParser.java in the OpenJDK 7
Ident:
IDENTIFIER
Qualident:
Ident { DOT Ident }
Literal:
INTLITERAL
| LONGLITERAL
| FLOATLITERAL
@c2nes
c2nes / sync_to_player_pls.py
Created August 26, 2012 20:41
Sync PLS file to MP3 player
#!/usr/bin/env python
import hashlib
import os
import os.path
import shutil
import sys
import urllib
import sqlite3
@c2nes
c2nes / sync_to_player.py
Created August 26, 2012 20:28
For syncing music to a MP3 player from clementine
#!/usr/bin/env python
import hashlib
import os
import os.path
import shutil
import sys
import urllib
import sqlite3