Skip to content

Instantly share code, notes, and snippets.

View thomd's full-sized avatar

Thomas Dürr thomd

  • Hamburg, Germany
View GitHub Profile
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@thomd
thomd / post-commit
Last active September 2, 2017 16:59
git hooks
#!/bin/sh
# take a picture and play happykids.wav (http://collectiveidea.com/assets/4c58e4c1dabe9d50eb000087/happykids.wav)
# from: collectiveidea.com/blog/archives/2010/08/03/happy-git-commits
imagesnap -q ~/.gitshots/$(date +"%Y-%m-%d_%H:%M:%S")_$(basename `pwd`).jpg & afplay ~/Music/happykids.wav > /dev/null 2>&1 &
@thomd
thomd / watch.sh
Created August 13, 2014 18:34 — forked from mikesmullin/watch.sh
#!/usr/bin/env bash
# script: watch
# author: Mike Smullin <[email protected]>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
\ProvidesFile{absender.lco}
\KOMAoptions{%
% fromemail=true, % Email wird im Briefkopf angezeigt
% fromphone=true, % Telefonnumer wird im Briefkopf angezeigt
% fromfax=true, % Faxnummer wird im Briefkopf angezeit
% fromurl=true, % URL wird im Briefkopf angezeigt
% fromlogo=true, % Logo wird im Briefkopf angezeigt
% subject=titled, % Druckt "Betrifft: " vor dem Betreff
locfield=wide, % Breite Absenderergänzung (location)
@thomd
thomd / summernote.html
Last active January 27, 2021 16:04
summernote example
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css">
<link rel="stylesheet" href="components/summernote/dist/summernote.css" />
</head>
<body>
@thomd
thomd / Application.java
Last active August 29, 2015 13:57
put model into play (1.x framework) session
package controllers;
import play.*;
import play.mvc.*;
import java.util.*;
import models.*;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.DeserializationConfig;
@thomd
thomd / semantic-layout.html
Last active November 11, 2024 20:30
Standard HTML5 Semantic Layout
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Title</title>
<link href="stylesheets/main.css" rel="stylesheet" />
</head>
<body>
<header>
<hgroup>
@thomd
thomd / play-build.gradle
Created February 22, 2014 23:55
gradle scripts for play framework
apply plugin: 'java'
apply plugin: 'js'
buildscript{
repositories{
mavenLocal()
mavenCentral()
}
dependencies{
@thomd
thomd / java-snippets.md
Last active April 29, 2024 18:31
Java code snippets

Java Snippets

Converting Strings to int and int to String

String a = String.valueOf(2); 
int i = Integer.parseInt(a);  

Convert String to Date