Skip to content

Instantly share code, notes, and snippets.

flying-sheep /
Last active May 17, 2017
split up “nup”d PDFs. depends on pdfjam and pdftk
# some PDFs are only delivered with multiple pages “nup”d onto one,
# e.g. 4 slides arranged 2×2 on one PDF page. This script separates them.
# horizontal×vertical nup layout, e.g.: '1x1' '2x2', '1x2'
# When re-nuping, add a frame? 'true' or 'false'
flying-sheep / bordered tiling.tikz
Created Jun 1, 2011
A quick hack of how you can derive tiles for automatic tiling from three source tiles (you can cramp the third one – the corners – into the second, since the space there isn’t needed)
View bordered tiling.tikz
\tikzstyle{glass}=[fill opacity=0.1]
\coordinate (empty) at (0,0);
\coordinate (borders) at ($(empty) + (\ts+\b, 0)$);
\coordinate (corners) at ($(borders) + (\ts+\b, 0)$);
flying-sheep /
Created Jun 4, 2011
Terraria Sprite Extractor
namespace WindowsGame2
import System.IO
import Microsoft.Xna.Framework
public class Extractor(Game):
private graphics as GraphicsDeviceManager
private basePath as string
private outPath as string
flying-sheep /
Created Jun 12, 2011
script to open markdown files. made by jezra, tweaks by me (can now open files)
#!/usr/bin/env python
Hey, this is GPLv3 and copyright 2010 Jezra
import sys, os
import gtk
import webkit
import markdown #
flying-sheep /
Created Jul 13, 2011
Mockup/prototype of a toolbarified page bar in okular
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
app = QApplication(sys.argv)
window = QMainWindow()
flying-sheep / remember
Created Jul 16, 2011
A perl script to notify oneself
View remember
#!/usr/bin/env perl
use strict;
use warnings;
use autodie;
use feature 'switch';
use English '-no_match_vars';
$| = 1;
my $msg = '';
flying-sheep /
Created Aug 3, 2011 — forked from martinth/ login script
# -*- coding: utf-8 -*-
import cookielib
from urllib2 import HTTPCookieProcessor, build_opener
from urllib import urlencode
from BeautifulSoup import BeautifulSoup
# the login data
login_data = {
'login_username': u'USERNAME',
'login_password': u'PASSWORD',
flying-sheep /
Created Aug 8, 2011 — forked from martinth/
A sample exception hook, that prints useful information if an AssertionError occures
#!/usr/bin/env python3
import sys, pprint
import os.path
# save old exception hook
sys._old_excepthook = sys.excepthook
def assert_hook(exc_type, exception, traceback):
if exc_type.__name__ == "AssertionError":
flying-sheep /
Created Sep 29, 2011
A bug exists for ages in Kubuntu (and afaik only there) that can be fixed by removing a superfluous file and rebuilding the MIME DB.
FIX_JAR_MIME="rm -vf /usr/share/mime/packages/sun-java*-jre.xml
update-mime-database /usr/share/mime"
if [ "$UID" -ne "$ROOT_UID" ]; then
kdesudo -c "$FIX_JAR_MIME"
kbuildsycoca4 #only possible if run as underprivileged
flying-sheep /
Created Aug 12, 2012
Scala Function & Tuple generator for java
#!/usr/bin/env python3
A script to generate the barebone implementation of scala’s
Function# and Tuple# types for use in java.
I made this to allow Java projects to specify function signatures
which play nice with scala, without depending on scala’s stdlib.
You can’t perform that action at this time.