Skip to content

Instantly share code, notes, and snippets.

View fgrosse's full-sized avatar
😎
automating all the things

Friedrich Große fgrosse

😎
automating all the things
View GitHub Profile
@fgrosse
fgrosse / Karatsuba.java
Created November 13, 2012 09:44
Implementation of the karatsuba multiplication
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Karatsuba {
private static final BigInteger ONE = new BigInteger("1");
private static final BigInteger TWO = new BigInteger("2");
@fgrosse
fgrosse / ticks_random_graph.tex
Created June 18, 2013 17:10
An example latex tickz script to create a random graph of wireless nodes and connect all pairs that are in each others transmission range.
\documentclass{article}
\usepackage[utf8x]{inputenc}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\makeatletter
\newcommand{\canvaswidth}{12}
\newcommand{\canvasheight}{6}
#!/bin/bash
# create a test dir stack
foostack() {
local i
[[ -d "$HOME/tmp" ]] && TEMPDIR="$HOME/tmp" || TEMPDIR="/tmp"
for ((i=1;i<10;i++)); do
mkdir -p "$TEMPDIR/testdir/dir-$i" && touch $TEMPDIR/testdir/{dir-$i,.}/file-{1..9}
done
echo "Done, look into $TEMPDIR/testdir"
}
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2010 The Authors