Skip to content

Instantly share code, notes, and snippets.

Florian Sesser hacklschorsch

View GitHub Profile
hacklschorsch /
Last active Nov 12, 2018
Java observable that notifies on changes to a File using Java 7 NIO and a separate thread.
import java.nio.file.*;
import java.util.Observable;
import static java.nio.file.StandardWatchEventKinds.*;
* FileChangeNotifier notifies its observers when @file has changed.
* It uses Java 7 NIO and runs in a separate thread (since the NIO call blocks).
hacklschorsch / gist:1a1d81e61465e5414864
Created Sep 29, 2014
Textsecure "database disk image is malformed" crash stack trace
View gist:1a1d81e61465e5414864
E/AndroidRuntime( 2108): FATAL EXCEPTION: main
E/AndroidRuntime( 2108): android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed
E/AndroidRuntime( 2108): at android.database.sqlite.SQLiteQuery.native_fill_window(Native Method)
E/AndroidRuntime( 2108): at android.database.sqlite.SQLiteQuery.fillWindow(
E/AndroidRuntime( 2108): at android.database.sqlite.SQLiteCursor.fillWindow(
E/AndroidRuntime( 2108): at android.database.sqlite.SQLiteCursor.getCount(
E/AndroidRuntime( 2108): at android.widget.CursorAdapter.getCount(
E/AndroidRuntime( 2108): at android.widget.HeaderViewListAdapter.getCount(
E/AndroidRuntime( 2108): at android.widget.AdapterView$AdapterDataSetObserver.onChanged(
E/AndroidRuntime( 2108): at android.database.DataSetObservable.notifyChanged(
hacklschorsch / gist:4109767
Created Nov 19, 2012
Example "run" file for Multilog
View gist:4109767
exec multilog t s999999 n20 ./main
hacklschorsch / gist:4109761
Created Nov 19, 2012
Add configuration to Daemontools Node.js/Meteor Config Directory
View gist:4109761
echo "mongodb://localhost/meteor" > service/nodejs/env/MONGO_URL
echo "3000" > service/nodejs/env/PORT
echo "" > service/nodejs/env/ROOT_URL
hacklschorsch / gist:4109730
Created Nov 19, 2012
Daemontools 'run' file for Meteor/NodeJS
View gist:4109730
echo Starting Node.js
exec 2>&1
exec envdir ./env node ../../bundle/main.js
hacklschorsch / forever_0.10.0_deps
Created Oct 12, 2012
Forever 0.10.0's crazy list of dependencies when installing (ignore 304s, but still. Also looks like npm outputs the GETs to fd 2.)
View forever_0.10.0_deps
fs@itagent-mws3%pts/2 (12:27) ~ > npm --no-color install -g forever | grep GET
zsh: correct 'forever' to '.forever' [nyae]? n
npm http GET
npm http 304
npm http GET
npm http GET
npm http GET
npm http GET
npm http GET
npm http GET
hacklschorsch / gist:2788752
Created May 25, 2012
GIT Hook-Chaining script
View gist:2788752
# Author: orefalo
# @see
# Changes:
# Add [0-9] to file glob to exclude .sample files
# Usage:
hacklschorsch / gist:2788656
Created May 25, 2012 — forked from founddrama/gist:1013614
a jshint pre-commit hook for git
View gist:2788656
# A pre-commit hook for git to lint JavaScript files with jshint
# @see
# @see
# @see
# Modified by 2012-05-22 for node.js and explicit /bin/bash
if git rev-parse --verify HEAD >/dev/null 2>&1
hacklschorsch / tmx_filename_patch_to_zf
Created Jan 19, 2012
Patch to Zend Framework 1.11.4 to add filename to exception description when TMX parsing fails
View tmx_filename_patch_to_zf
Index: library/Zend/Translate/Adapter/Tmx.php
--- library/Zend/Translate/Adapter/Tmx.php (revision 3015)
+++ library/Zend/Translate/Adapter/Tmx.php (working copy)
@@ -74,9 +74,10 @@
xml_set_character_data_handler($this->_file, "_contentElement");
if (!xml_parse($this->_file, file_get_contents($filename))) {
- $ex = sprintf('XML error: %s at line %d',
+ $ex = sprintf('XML error: %s at line %d of file %s',
hacklschorsch / xslt_google_wetter_3.xslt
Created Dec 19, 2011
XSL transform the Google Weather Feed into HTML (sorry, the annotations are in German)
View xslt_google_wetter_3.xslt
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0"
<credit>Florian Sesser für CoSeTrain</credit>
You can’t perform that action at this time.