Skip to content

Instantly share code, notes, and snippets.

View Anticom's full-sized avatar
:octocat:
octocode

Timo Mühlbach Anticom

:octocat:
octocode
View GitHub Profile
@Anticom
Anticom / CoffeeCounter.coffee
Created May 8, 2014 08:51
NoFlo counting component
noflo = require 'noflo'
class CoffeeCounter extends noflo.Component
description: 'This is my test description.'
icon: 'gear'
constructor: ->
@current = 0
@inPorts =
@Anticom
Anticom / app.css
Created July 4, 2014 10:30
AngularJS - Timed $watch test
body {
background-color: white;
}
.model-box {
padding: 1em;
border: 1px solid #ccc;
-webkit-border-radius: 10px;
@Anticom
Anticom / geo.sql
Created July 31, 2014 15:09
location based search
SELECT
dest.sn,
dest.ort,
dest.kreis,
ACOS(
SIN(RADIANS(src.lat)) * SIN(RADIANS(dest.lat))
+ COS(RADIANS(src.lat)) * COS(RADIANS(dest.lat))
* COS(RADIANS(src.lon) - RADIANS(dest.lon))
) * 6380 AS distance
FROM
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
@Anticom
Anticom / Point3d_karthesian.java
Last active December 17, 2015 18:49
Java convert karthesian coordinate to spherical back and forth failure
package javax.vecmath;
import com.sun.corba.se.impl.interceptors.PICurrent;
public class Point3d_karthesian extends Point3d {
public Point3d_karthesian() {
super();
}
public Point3d_karthesian(double[] arg0) {
@Anticom
Anticom / Runner.java
Created May 27, 2013 15:33
interploate spherical coordinates
import java.util.ArrayList;
import javax.vecmath.Point3d;
import javax.vecmath.Point3d_karthesian;
import javax.vecmath.Point3d_spherical;
import javax.vecmath.Vector3d;
public class Runner {
/**
<?php
$fmt = new NumberFormatter('de_DE', NumberFormatter::DECIMAL);
$float = 123.456;
echo $fmt->format($float);
# http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/
[alias]
#...
#from pretty (verbose) to less verbose
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg3 = log --color --graph --pretty=format:'%C(bold blue)%h%Creset -%C(bold yellow)%d%Creset %s %C(bold green)(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
#default
lg = !"git lg1"
@Anticom
Anticom / awk.awk
Last active February 29, 2016 09:43
#!/usr/bin/awk -f
BEGIN{
}
#match splits, need to print the line before aswell
/.*\/([0-9a-f]{7}\W)?.*$/{
print thelinebefore
print $0
}
#match merges, need to print the line after aswell
/.*\\([0-9a-f]{7}\W)?.*$/{
package eu.anticom.model.opensearch;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import eu.anticom.serializer.ContactDeserializer;
import eu.anticom.serializer.ContactSerializer;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import java.io.UnsupportedEncodingException;