Skip to content

Instantly share code, notes, and snippets.

@daniw
daniw / gist:5108495
Created March 7, 2013 14:43
Beispiel für ein Venndiagramm
\begin{venndiagram2sets}[tikzoptions={scale=0.5}]
\fillA \fillB
\end{venndiagram2sets}
@daniw
daniw / forbackward.java
Created November 10, 2013 19:54
Printing out an array forward and backward.
public void forward(int[] intarray, int pointer) {
System.out.println(intarray[pointer]);
if (pointer < intarray.length-1) {
forward(intarray, pointer + 1);
}
}
public void backward(int[] intarray, int pointer) {
if (pointer < intarray.length-1) {
backward(intarray, pointer + 1);
@daniw
daniw / ltspice.sh
Last active March 7, 2024 04:39
install ltspice on ubuntu (arch commented)
# install wine and ltspice
sudo apt-get install wine
# sudo pacman -S wine
cd /tmp/
wget http://ltspice.linear-tech.com/software/LTspiceIV.exe
wine LTspiceIV.exe
rm LTspiceIV.exe
# start lstpice through wine
wine ~/.wine/drive_c/Program\ Files/LTC/LTspiceIV/scad3.exe
@daniw
daniw / conv-min-zero.sh
Last active January 1, 2016 10:49
replace all "-" with "0"
# replace all "-" with "0" in test2
sed -i -e 's/-;/0;/g' -e 's/-$/0/g' test2
# replace all "-" with "0" in all files in local directory
for i in *; do sed -i -e 's/-;/0;/g' -e 's/-$/0/g' $i; done
# replace all "-" with "0" in all files in all subdirectories
for i in */*; do sed -i -e 's/-;/0;/g' -e 's/-$/0/g' $i; done
# replace all "-" with "0" in all *.csv files in all subdirectories
@daniw
daniw / contributors.sh
Created February 13, 2014 08:35
List all Contributors in all repositorys in current folder
for i in *; do cd $i; echo $i; git shortlog -s -n; cd ..; done