Skip to content

Instantly share code, notes, and snippets.

View dettmering's full-sized avatar

Till Dettmering dettmering

View GitHub Profile
@dettmering
dettmering / ping.1m.py
Created January 30, 2019 08:12
BitBar plugin for showing host availability
#!/usr/local/bin/python3
import os
hosts = [
'google.com',
'microsoft.com'
]
header = []
@dettmering
dettmering / docx2pdf.scpt
Created April 17, 2019 14:18
Apple Script to convert DOCX into PDF
on run {input, parameters}
tell application id "com.microsoft.Word"
activate
repeat with aFile in input
open aFile
set theOutputPath to ((aFile as text) & ".pdf")
tell active document
save as it file name theOutputPath file format format PDF
close saving no
end tell
@dettmering
dettmering / gist:3767366
Created September 22, 2012 18:43
Python: Read CSV file into array
def readcsv(filename):
ifile = open(filename, "rU")
reader = csv.reader(ifile, delimiter=";")
rownum = 0
a = []
for row in reader:
a.append (row)
rownum += 1
@dettmering
dettmering / drawio-export-pdf.sh
Created July 11, 2019 09:56
draw.io: Export all .drawio files in folder to PDF and PNG while preserving history. Very useful as a post-commit hook.
#!/bin/bash
rm -f *.pdf
rm -f *.png
COMMIT=$(git rev-parse HEAD)
for f in *.drawio
do
/Applications/draw.io.app/Contents/MacOS/draw.io --export --all-pages --output $f.pdf $f