Skip to content

Instantly share code, notes, and snippets.

View 166MMX's full-sized avatar

Johannes Harth 166MMX

View GitHub Profile

Creating a TimerTask can not get easier than this thanks to groovy.

  • import java.util.timer.* is not required as java.util is already imported.
  • the run() is implemented as closure

To Run this:

groovy https://gist.github.com/kdabir/3176945/raw/timer_example.groovy

@166MMX
166MMX / env
Last active December 19, 2015 00:29
ANT_HOME=C:\Program Files\apache-ant-1.8.4
GRADLE_HOME=C:\Program Files\gradle-1.5
GROOVY_HOME=C:\Program Files\Groovy\Groovy-2.1.0
IDEA_HOME=C:\Program Files\JetBrains\IntelliJ IDEA 12.1
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
M2_HOME=C:\Program Files\apache-maven-3.0.4
M2=%M2_HOME%\bin
GIT_SSH=C:\Program Files\PuTTY\plink.exe
SVN_SSH=C:\\Program Files\\PuTTY\\plink.exe
#!/usr/bin/python
#
# git-slim
#
# Remove big files from git repo history.
#
# Requires GitPython (https://github.com/gitpython-developers/GitPython)
#
# References:
# - http://help.github.com/remove-sensitive-data/
(function () {
var dInputElements = document.getElementsByTagName('input');
for (var i = dInputElements.length - 1; 0 <= i; i--) {
var dInputElement = dInputElements[i];
if ('checkbox' === dInputElement.type) {
dInputElement.click();
}
}
}());
@166MMX
166MMX / 89653.user.js
Last active December 20, 2015 08:19
Facebook: InviteThemAll
// ==UserScript==
// @name Facebook: InviteThemAll
// @namespace Aspi
// @description Adds a button to select multiple, thus all, friends in the "invite friends" dialog at Facebook.
// @include /https?://(|.*\.)facebook.com/?.*/
// @require http://usocheckup.redirectme.net/89653.js?method=update
// @require https://gist.github.com/166MMX/3845101/raw
// @version 2.17
// ==/UserScript==
svn-fs-dump ::= version-record
[ uuid-record ]
( revision-record node-record+ )+
version-record ::= version-header "\n"
uuid-record ::= uuid-header "\n"
//noinspection JSUnusedLocalSymbols
var consoleLog = function consoleLog ()
{
Array.prototype.unshift.call(arguments, 'log');
safeConsoleLog.apply(this, arguments);
};
//noinspection JSUnusedLocalSymbols
var consoleDebug = function consoleDebug ()
{
@166MMX
166MMX / gist:8208917
Created January 1, 2014 15:39
Game Extractor trying to write into C:\Program Files (x86)\Game Extractor eventually crashing with a stackoverflow. http://www.watto.org/extract/info.html
$ systeminfo.exe
OS Name: Microsoft Windows 7 Professional
OS Version: 6.1.7601 Service Pack 1 Build 7601
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
Original Install Date: 5/1/2010, 2:10:54 PM
System Boot Time: 1/1/2014, 3:43:23 PM
System Type: x64-based PC
#!/usr/bin/env python
import sys
import datetime
frankierart={
0x01:'Stampit 2003',
0x02:'0x02???',
0x03:'Frankit',
0x05:'Filiale',
0x07:'Frankierservice Infopost/Infobrief',
0x08:'Premiumadress',
class ProgressBar
{
private int max
private int current
private int width
private String name
private long start
private long lastUpdate
private PrintStream ps