Skip to content

Instantly share code, notes, and snippets.

@digulla
digulla / AbstractRebuildingPreferencePage.java
Created April 10, 2012 13:49
Refactored org.cloudsmith.geppetto.pp.dsl.ui.preferences.AbstractRebuildingPreferencePage
/**
* Copyright (c) 2011 Cloudsmith Inc. and other contributors, as listed below.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Cloudsmith
* Aaron Digulla
@digulla
digulla / diffFolders.py
Created March 22, 2012 11:15
Small script to copy the difference between two folders to a new folder
#!/usr/bin/env python
import os
import os.path
import sys
import shutil
# Bugfixed version of makedirs
def makedirs(name, mode=0777):
"""makedirs(path [, mode=0777])
@digulla
digulla / SDL-1.2.14-x11modes.patch
Created December 4, 2011 11:43
Patch to force a certain window/screen size in SDL games
--- SDL-1.2.14/src/video/x11/SDL_x11modes.c 2009-10-13 01:07:15.000000000 +0200
+++ SDL-1.2.14/src/video/x11/SDL_x11modes.c 2011-12-04 12:34:55.000000000 +0100
@@ -33,7 +33,7 @@
#include "SDL_x11modes_c.h"
#include "SDL_x11image_c.h"
-/*#define X11MODES_DEBUG*/
+#define X11MODES_DEBUG
#define MAX(a, b) (a > b ? a : b)
@digulla
digulla / LineNumberTest.java
Created September 1, 2011 12:02
Demo for SimpleXml line number problem
package net.sf.simple.test;
import static org.junit.Assert.*;
import java.io.StringReader;
import org.junit.Test;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Root;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
@digulla
digulla / c't_Inhaltsverzeichnis_sortieren.user.js
Last active August 29, 2015 14:12
Sortiert das Inhaltsverzeichnis der c't nach Seitenzahl, wenn man auf "aktuell" klickt
// ==UserScript==
// @name c't Inhaltsverzeichnis sortieren
// @namespace http://www.pdark.de/
// @version 1.0
// @description Sortiert das Inhaltsverzeichnis der c't nach Seitenzahl, wenn man auf "aktuell" klickt
// @match https://www.heise.de/artikel-archiv/ct/*
// @copyright 2014+, Aaron Digulla
// @grant unsafeWindow
// ==/UserScript==
@digulla
digulla / OrphanNodesTool.groovy
Created October 24, 2014 10:20
Groovy tool to count, list or delete orphaned nodes in a database with proper FK relations
import groovy.sql.Sql
class OrphanNodesTool {
Sql sql;
String schema;
Set<String> tablesTargetedByForeignKeys() {
def query = '''\