Skip to content

Instantly share code, notes, and snippets.

{
"meta": {
"theme": "flat"
},
"basics": {
"name": "Tom Hermann",
"label": "Agile Developer",
"picture": "http://0.gravatar.com/avatar/50d7947cb5ed517406f0be1eb9a950c0?s=200",
"email": "tomhermann@gmail.com",
"website": "https://tomhermann.me",
@tomhermann
tomhermann / RxExt.kt
Created March 28, 2019 20:00
Debug "Operator" for RxKotlin.
package com.zombietank.rx
import io.reactivex.*
import timber.log.Timber
private const val TAG = "rxDebug"
private fun log(tag: String) = Timber.tag(tag)
fun <T> Observable<T>.debug(tag: String = TAG): Observable<T> {
git config --global alias.co checkout
git config --global alias.st status
git config --global alias.br branch
git config --global alias.ci commit
@tomhermann
tomhermann / gist:6059666
Last active December 20, 2015 02:49
Writing a baby android app to lock my computer remotely, I'm sure this has its issues, but works on my machine :)
package com.zombietank;
import java.io.IOException;
public class SystemControl {
public boolean lockComputer() {
return executeAndWait("rundll32.exe", "user32.dll,LockWorkStation");
}
@tomhermann
tomhermann / gradle.properties
Created April 15, 2012 20:24
gradle properties for maven deployment
##############################################################################
# This file lives at ~/.gradle/gradle.properties, and supplies secure details
# for 'gradle uploadArchives'
##############################################################################
# keyId from 'gpg --list-keys'
signing.keyId=
# passphrase used when generating key
signing.password=
@tomhermann
tomhermann / lighttpd-tomcat.conf
Created February 24, 2012 02:38
lighttpd proxy to tomcat
# use with mod_proxy
$HTTP["host"] =~ "(^|\.)server\.com$" {
proxy.server = (
"" => (
"tomcat" => (
"host" => "127.0.0.1",
"port" => 8080,
"fix-redirects" => 1
)
@tomhermann
tomhermann / lighttpd-301.conf
Created February 24, 2012 02:36
lighttpd 301 redirect for a domain
$HTTP["host"] =~ "^source\.com$" {
url.redirect = ( "^/(.*)" => "http://dest.com/$1")
}
@tomhermann
tomhermann / build.gradle
Created October 27, 2011 00:50
Gradle war build with aspectj support
apply plugin: "war"
apply plugin: "jetty"
apply from:"https://raw.github.com/tomhermann/gradle-scripts/master/sources-javadoc.gradle"
apply from:"https://raw.github.com/breskeby/gradleplugins/0.9-upgrade/aspectjPlugin/aspectJ.gradle"
repositories {
mavenRepo urls: "http://repo.jfrog.org/artifactory/repo"
}
version = "0.0.4.SNAPSHOT"
apply plugin: 'war'
apply plugin: 'groovy'
apply plugin: 'jetty'
apply plugin: 'eclipse'
version = '1.0'
springVersion='3.0.5.RELEASE'
slf4jVersion='1.6.1'
sourceCompatibility = 1.6
@tomhermann
tomhermann / gist:890877
Created March 28, 2011 17:23
Found some of my earlier college C++ work on an old hard drive... man this was bad.
template <class T>
Matrix<T> gaussian_solver<T>::operator()(const Matrix<T>& A, const Vector<T>& b) {
if(!A.is_square()) {
throw CSignal("Gaussian solver can only be applied to square matrices");
}
Matrix<T> system = A; // make a copy because we're going to mess it up
Vector<T> row_temp;
system = system.augment(b); // Augment vector b, now we have a system