Skip to content

Instantly share code, notes, and snippets.

View danielbuechele's full-sized avatar

Daniel Büchele danielbuechele

View GitHub Profile
@danielbuechele
danielbuechele / atemClient.py
Created May 31, 2012 15:31
atemClient Error
#!/usr/bin/env python
#
# atemClient.py
# Copyright (c) 2012 Thorsten Philipp <kyrios@kyri0s.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation the rights to use, copy,
# modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so, subject to the
ffmpeg -v 3 -i movie.mov -re -acodec libfaac -ab 64k -ar 44000 -ac 1 -strict experimental -vcodec libx264 -b 600k -bt 225k -minrate 400k -maxrate 800k -bufsize 887.04k -r 25 -s 720x400 -aspect 16:9 -trellis 1 -subq 7 -me_range 16 -i_qfactor 0.71 -bf 3 -b_strategy 1 -refs 2 -partitions partp8x8 -flags +loop -flags2 +dct8x8 -g 50 -qmin 1 -qmax 51 -qdiff 4 -qcomp 0.5 -level 30 -sc_threshold 40 -sn -threads 8 -f flv rtmp://...
@danielbuechele
danielbuechele / gist:3817731
Created October 2, 2012 09:22
Sign Apple Passbook manifest.json
openssl smime -binary -sign -signer ./cert.pem -inkey ./key.pem -in ./manifest.json -out ./signature -outform DER
choc ~/.bash_profile
alias server="python -m SimpleHTTPServer 8000"
@danielbuechele
danielbuechele / style.css
Last active August 29, 2015 14:02
Bootstrap screen sizes
@media (max-width:767px) {}
@media (min-width:768px) and (max-width:991px) {}
@media (min-width:992px) and (max-width:1199px) {}
@media (min-width:1200px) {}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {}
@danielbuechele
danielbuechele / userscript.js
Last active June 13, 2017 18:53
Fluidapp Userstyle for Facebook Messenger
window.fluid.dockBadge = '';
var notify = true;
setInterval(updateDockBadge, 500);
function updateDockBadge() {
var count = document.querySelector(".pls._1r.fwn:not(.hidden_elem)");
if (count) {
if (notify) {
var title = document.querySelector('._kx ._l2 ._l1').textContent;
var text = document.querySelector('._kx ._l3').textContent;
@danielbuechele
danielbuechele / gist:df0d17b6840e1513bfbc
Created March 21, 2015 12:46
Converting Emoji String to HTML and back
// Playground - noun: a place where people can play
import UIKit
let str = "Test 🇯🇵"
var str2 = ""
for char in str.unicodeScalars {
if (char.value>7936) {
str2 += "&#"+String(Int(char.value))+";"
@danielbuechele
danielbuechele / gist:36cf91edf3ea0da6a4a6
Last active August 29, 2015 14:17
HTML encode emojis
NSString *text = @"😀abc🇯🇵";
NSMutableString *convertedText = @"".mutableCopy;
[text enumerateSubstringsInRange:NSMakeRange(0,[text length]) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
unsigned int i = (unsigned int)*(const UInt32 *)[[substring dataUsingEncoding:NSUTF8StringEncoding] bytes];
if (i > 8436960) {
NSData *data = [substring dataUsingEncoding:NSUTF32BigEndianStringEncoding];
NSString *str = [NSString stringWithFormat:@"%@",data];
@danielbuechele
danielbuechele / gist:b0c0b605be68736e1a28
Last active August 29, 2015 14:20
Flying Lufthansa you can access a flight information JSON-API via their on-board WiFi at http://map.boardconnect.aero/api/flightdata
{
"lon": 6.894092559814453,
"lat": 50.272064208984375,
"groundSpeed": 499.7942175120898,
"heading": 108.9605,
"orig": {
"lon": -0.461389,
"lat": 51.4775,
"code": "LHR"
},
@danielbuechele
danielbuechele / dbe2json.js
Created May 27, 2016 13:05
Convert DIGAS .DBE filte to JSON
var fs = require('fs');
const keyRegex = /(\[[A-Z\/#0-9]+\])/;
if (process.argv.length < 3) {
console.error('No file name given.');
process.exit(1);
} else {
parse(process.argv[2]).then(o => {
console.log(o);
});