Skip to content

Instantly share code, notes, and snippets.

View monkeydom's full-sized avatar

Dominik Wagner monkeydom

View GitHub Profile
@monkeydom
monkeydom / SingletonMacro.h
Last active December 24, 2015 17:19
New try on Singleton non-redundancy
/** usage example
@implementation ABCPlayerManager
+ (instancetype)sharedPlayerManager {
return TCM_SINGLETON(ABCPlayerManager);
}
@end
*/
#define TCM_SINGLETON(THECLASS) ({ \
static THECLASS *s_sharedInstance = nil; \
@monkeydom
monkeydom / MacPro
Created October 29, 2013 18:36
Mac Pro Apple Copy
It's the computer we were insane to build.
The one that turns conventional thinking on its head, then kicks the living $#&% out of it.
We challenged all our assumptions.
Abandoned our preconceptions.
And Blew away limitation after limitation.
This is the new Mac Pro.
It's like no Mac we've created before.
And we can't wait to see what you create with it.
@monkeydom
monkeydom / gist:8212210
Created January 1, 2014 22:28
command line help to download all congress session videos
#!/bin/sh
# before that do e.g. brew install lynx and brew install aria2
for x in `lynx http://cdn.media.ccc.de/congress/2013/mp4/ --dump | grep "http" | grep "30c3" | cut -c 7-`; do
echo "$x".torrent;
done > SessionTorrentList.txt
aria2c --seed-time=0 -Z -i SessionTorrentList.txt
import Foundation
let argumentCount = Int(C_ARGC)
var argumentArray: Array<String> = Array<String>()
for index in 0..argumentCount {
argumentArray.append(String.fromCString(C_ARGV[index]))
}
dom@domair:~/bin$ cat swift-optparser.swift
#!/usr/bin/env xcrun swift -i
// add e.g. -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk'
// to be able to import Cocoa Frameworks
var argumentArray = Array<String>()
for index in 0..Int(C_ARGC) {
argumentArray.append(String.fromCString(C_ARGV[index]))
@monkeydom
monkeydom / swiftc.sh
Last active October 24, 2015 23:50
Script to be used in a hashbang to conditionally compile and then run the swift script referenced. usage #!/usr/bin/env swiftc.sh in your swift file, and put in path
#!/bin/sh
SWIFT=$(/usr/bin/env xcrun -f swift)
SCRIPTPATH=$1
COMPILEDPATH="$SCRIPTPATH.o"
SDKPATH=$(/usr/bin/env xcrun --show-sdk-path --sdk macosx)
#compile if necessary
@monkeydom
monkeydom / normalize-pdf.sh
Created October 12, 2018 07:44
Takes a pdf, removes metadata and generates a deterministic version based on the contents so version control is happy.
#!/bin/sh
TEMP=${1}_tmp
QPDF=${TEMP}_qpdf
cp $1 $TEMP
exiftool -all:all= -overwrite_original_in_place $TEMP
qpdf --deterministic-id --linearize $TEMP $QPDF
perl -pi -ne 's/(\/ID\s*\[<*)([\d+a-fA-F]*)(>\s*<)([\d+a-fA-F]*)(>)/\1\4\3\4\5/g' $QPDF
cp $QPDF $1
rm $QPDF $TEMP
@monkeydom
monkeydom / videoconvert.sh
Created February 16, 2021 11:32
My MediathekView convert to h265 video script
#!/bin/sh
mkdir -p Converting
mkdir -p Source
mkdir -p Converted
for f in *.mp4; do
o=${f##*/}
t=${o%.*}.h265.mp4
ffmpeg -i "$f" \
on seescriptsettings()
return {keyboardShortcut:"$@o", shortDisplayName:"New Document", displayName:"New Document with Date"}
end seescriptsettings
to secsToHMS(secs)
tell (1000000 + secs div hours * 10000 + secs mod hours div minutes * 100 + secs mod minutes) as string ¬
to return text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7
end secsToHMS
set {year:y, month:m, day:d, time:t} to current date
Sehr geehrter Herr Eisenberg,
in der vorbezeichneten Angelegenheit kommen wir zurück auf Ir Schreiben vom 16. No-
ember 2021 und geben nachfolgende Unterlassungsverpflichtungserklärung ab.
Die Axel Springer SE verpflichtet sich - ohne Präjudiz für die Sach- und Rechtslage und
one Anerkennung einer Rechtspflicht, gleichwohl rechtsverbindlich - gegenüber
Frau Ines Aniol, es bei Meidung einer für den Fall der schuldhaften Zuwiderhandlung von
Frau Ines Aniol festzusetzenden, im Streitfall der Höhe nach vom zuständigen Gericht zu
Überprüfenden und an Frau Ines Aniol zu zahlenden Vertragsstrafe zu unterlassen, zU
verbreiten und/oder verbreiten zu lassen und/oder öffentlich zugänglich zu machen
und/oder öffentlich zugänglich machen zu lassen: