Skip to content

Instantly share code, notes, and snippets.

View MoriTanosuke's full-sized avatar

Carsten MoriTanosuke

View GitHub Profile
@MoriTanosuke
MoriTanosuke / gallery.sh
Created February 5, 2012 13:40
Recursive create a gallery from all images in a directory
@MoriTanosuke
MoriTanosuke / privacyimg.html
Created October 25, 2011 14:05
privacyimg von Tilli.me
<div id="testbild"></div>
<script type="text/javascript">//<!--
var img = document.createElement('img');
img.src = 'http://tilli.me/privacyimg/einbild.png';
document.getElementById('testbild').appendChild(img);
//--></script>
@MoriTanosuke
MoriTanosuke / new.java
Created August 16, 2011 16:47
Functional style java
private static final DateFormat FORMAT_HOURS = loadDateFormat();
...
ObjectTuple[] tuples = new ObjectTuple[] {
new ObjectTuple(myObject.getThisAttribute("attr1"), myObject.get("firstkeyA"), myObject.get("firstkeyB")),
new ObjectTuple(myObject.getThisAttribute("attr2"), myObject.get("secondkeyA"), myObject.get("secondkeyB")),
new ObjectTuple(myObject.getThisAttribute("attr3"), myObject.get("thirdkeyA"), myObject.get("thirdkeyB")),
};
@MoriTanosuke
MoriTanosuke / CsvBean.java
Created June 23, 2011 18:58
Unmarshal CSV with Apache Camel and Bindy
package de.kopis.camel.model;
import org.apache.camel.dataformat.bindy.annotation.CsvRecord;
import org.apache.camel.dataformat.bindy.annotation.DataField;
@CsvRecord(separator = ",")
public class CsvBean {
@DataField(pos = 1)
private String first;
@DataField(pos = 2)
@MoriTanosuke
MoriTanosuke / core.clj
Created March 1, 2011 19:51
Simple functions to have something testable.
(ns clj-testtest.core)
(defn foo
[a b] (str a ":" b))
(defmacro mfoo
[a b] `(str ~a ":" ~b))
(defn gen-foo
[a b c] (defn a [b c] (str b ":" c)))
@MoriTanosuke
MoriTanosuke / hallowelt.clj
Created November 30, 2010 05:16
Ein erweitertes Hallo Welt mit Var
(def msg "Hallo Welt")
(println msg)
@MoriTanosuke
MoriTanosuke / hallowelt.clj
Created November 30, 2010 05:12
Einfaches Hallo Welt in Clojure
(println "Hallo, Welt!")
var huk;
function xchat_plugin_init()
{
huk = xchat_hook_server("PRIVMSG", XCHAT_PRI_NORM, "growlify", NULL);
}
function growlify(from, command, nickname, message)
{
var me = xchat_get_info("nick");
package de.kopis.wave.robot;
import java.util.logging.Logger;
import com.google.wave.api.AbstractRobotServlet;
import com.google.wave.api.Blip;
import com.google.wave.api.Event;
import com.google.wave.api.RobotMessageBundle;
import com.google.wave.api.TextView;
import com.google.wave.api.Wavelet;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class Grep {
public static void main(String[] args) throws IOException {
if(args.length != 2) {
System.err.println("Wrong parameter count!");
System.err.println("USAGE:\tjava Grep pattern file");