Skip to content

Instantly share code, notes, and snippets.

View julianthome's full-sized avatar
⌨️
¯\_(ツ)_/¯

Julian julianthome

⌨️
¯\_(ツ)_/¯
View GitHub Profile
@julianthome
julianthome / README.md
Created April 3, 2017 13:19 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@julianthome
julianthome / render.sh
Last active December 8, 2016 11:04
Automatically render PDFs from dot files. A filesystem notifier is watching a directory; once a dot file is created within this directory, this script will fully automatically create the corresponding PDF file and display it using the standard PDF viewer on your system. Note that this script is platform dependent (MAC OSX). However, by exchangin…
#!/bin/bash
INPUT_DIR="/tmp/spool/in"
OUTPUT_DIR="/tmp/spool/out"
DELAY=4
PIDFILE="/tmp/workdog.pid"
FIFO="/tmp/render.fifo"
LOGGING="stdout"
@julianthome
julianthome / Client.java
Created December 7, 2016 10:25
IPC between Matlab and Java programs. Server process which can be started in Matlab by invoking extserver(<port>) and Java Client wich can be invoked from Java program for sending data to Matlab
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;
import java.util.Arrays;
import java.util.Set;
public class Client {
public static void main(String[] args) {
#!/bin/bash
# make variables available in function started by
# gnu parallel
export FINALRES="result"
export WPSIZE=5
export JOBLOG="joblog"
function getfiles() {
find ./* -name "*.txt"
@julianthome
julianthome / testpath.sh
Created September 18, 2016 14:23
Check correctness of pathname
#!/bin/bash
DELIM="/"
FILE="[a-zA-Z]([a-zA-Z0-9])*"
R="(${DELIM})?${FILE}(${DELIM}${FILE})*${DELIM}?"
path=$1
echo "$path" | egrep -x "$R"
@julianthome
julianthome / StopWatch.java
Created September 18, 2016 12:48
A simple stop watch implemented in Java
public class StopWatch {
long start;
long end;
long time;
long overallTime = 0;
public static StopWatch get() {
return new StopWatch();
}
@julianthome
julianthome / excel2csv.py
Last active June 1, 2022 04:36
Python script to export excel sheets to CSV from a workbook in UTF-8
#!/usr/bin/env python
# export data sheets from xlsx to csv
from openpyxl import load_workbook
import csv
from os import sys
def get_all_sheets(excel_file):
sheets = []