Skip to content

Instantly share code, notes, and snippets.

@digulla
digulla / c't_Inhaltsverzeichnis_sortieren.user.js
Last active Aug 29, 2015
Sortiert das Inhaltsverzeichnis der c't nach Seitenzahl, wenn man auf "aktuell" klickt
View c't_Inhaltsverzeichnis_sortieren.user.js
// ==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 Oct 24, 2014
Groovy tool to count, list or delete orphaned nodes in a database with proper FK relations
View OrphanNodesTool.groovy
import groovy.sql.Sql
class OrphanNodesTool {
Sql sql;
String schema;
Set<String> tablesTargetedByForeignKeys() {
def query = '''\
@digulla
digulla / Default (Linux).sublime-keymap
Last active Aug 21, 2018
Eclipse keyboard mapping for Sublime Text 2+3, based on https://gist.github.com/thbkrkr/3194275
View Default (Linux).sublime-keymap
// Put this in .../Packages/User/Default (**YOUR_OS_HERE**).sublime-keymap
[
// Eclipse keyboard mapping for Sublime Text 2+3, based on https://gist.github.com/thbkrkr/3194275
{ "keys": ["f12"], "command": "htmlprettify"},
{ "keys": ["f1"], "command": "fold" },
{ "keys": ["f2"], "command": "unfold" },
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },
{ "keys": ["ctrl+space"], "command": "auto_complete" },
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context":
@digulla
digulla / RunPlattyRun_V7
Created Dec 18, 2013
Writing Games with Processing: Highscore!
View RunPlattyRun_V7
// Version 7: Scoring
int px = 320, py = 240;
int tileSize = 20;
int score = 0;
int signum(float value) {
return value < 0 ? -1 : value > 0 ? 1 : 0;
}
@digulla
digulla / RunPlattyRun_V6
Created Dec 18, 2013
Writing Games with Processing: Winning
View RunPlattyRun_V6
// Version 6: Winning the game
int px = 320, py = 240;
int tileSize = 20;
int signum(float value) {
return value < 0 ? -1 : value > 0 ? 1 : 0;
}
class Enemy {
@digulla
digulla / RunPlattyRun_V5
Last active Dec 31, 2015
Writing Games with Processing: Eating Platty
View RunPlattyRun_V5
// Version 5: Eating Platty
int px = 320, py = 240;
int tileSize = 20;
int signum(float value) {
return value < 0 ? -1 : value > 0 ? 1 : 0;
}
class Enemy {
@digulla
digulla / RunPlattyRun_V4
Created Dec 18, 2013
Writing Games with Processing: Hunting Platty
View RunPlattyRun_V4
// Version 4: Hunting Platty
int px = 320, py = 240;
int tileSize = 20;
int signum(float value) {
return value < 0 ? -1 : value > 0 ? 1 : 0;
}
class Enemy {
@digulla
digulla / RunPlattyRun_V3
Last active Dec 31, 2015
Writing Games with Processing: Moving Around
View RunPlattyRun_V3
// Version 3: Moving Around
int px = 320, py = 240;
int tileSize = 20;
class Enemy {
color c;
int x, y;
String name;
@digulla
digulla / RunPlattyRun_V2
Created Dec 15, 2013
Writing Games with Processing: Enemies
View RunPlattyRun_V2
// Version 2: Enemies
int px = 320, py = 240;
int tileSize = 20;
class Enemy {
color c;
int x, y;
String name;
@digulla
digulla / RunPlattyRun_V1
Created Dec 15, 2013
Writing Games with Processing: Setup and a Simple Player Character
View RunPlattyRun_V1
// Version 1: Setup and a Simple Player Character
void setup() {
size(640, 480); //VGA for those old enough to remember
}
int px = 320, py = 240;
int tileSize = 20;
void drawPlatty() {