Skip to content

Instantly share code, notes, and snippets.

View gangeli's full-sized avatar

Gabor Angeli gangeli

View GitHub Profile
@gangeli
gangeli / javac
Last active June 14, 2019 18:26
Incremental Java compiler
#!/bin/bash
#
# An incremental version of the `javac` command, intended to be backwards
# compatible but faster to invoke.
#
# Example Usage:
#
# ./javac_inc -d path/to/build /path/to/src/dir /path/to/other/src/dir
#
# Some minor differences from default Javac, intended to be features:
@gangeli
gangeli / tikz2png.sh
Last active June 21, 2018 12:57
A script to convert Tikz images to PNG format
#!/bin/bash
#
# A quick and dirty bash script to convert a tikz image to a png.
# The necessary tweaks to the script to get it to work for your
# use case are as follows:
#
# 1. Change FIGURE_DEFINITIONS to point to your own figures.
# This file should contain a series of \newcommand definitions,
# one per figure.
#
@gangeli
gangeli / wikipedia2text
Created April 13, 2014 05:26
A wrapper around wp2txt with parallelism and extra cleaning
#!/bin/bash
exec scala -J-Xmx4G -J-Xss16m "$0" "$@"
!#
/*
* Convert a Wikipdedia dump to plain-text files, one article per file.
*
* Usage: wikipedia2text <input_dump_file> <output_directory>
*
* NOTES:
@gangeli
gangeli / fsed.cc
Last active August 29, 2015 13:59
Fast "sed" for find/replace over a large pattern set
/**
* Fast "sed" for performing find/replace on a huge number of patterns, not
* requiring any actual regular expression matching.
* Note that this is in no way "fully featured" or really anything like sed,
* beyond the fact that I use sed almost exclusively for find/replace and the
* patterns file is nominally compatible with real sed.
*
* To compile: g++ -std=c++0x -O3 fsed.cc -o fsed
*
* Usage: ./fsed <path_to_patterns_file>