Skip to content

Instantly share code, notes, and snippets.

Robin Kunde robinkunde

Block or report user

Report or block robinkunde

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
robinkunde / fontNames.swift
Created Aug 21, 2019
Print certain font names
View fontNames.swift
for familyName in UIFont.familyNames.sorted() {
var hasPrintedFamilyName = false
for fontName in UIFont.fontNames(forFamilyName: familyName).sorted() {
let font = UIFont(name: fontName, size: 16.0)!
guard font.fontDescriptor.symbolicTraits.contains(.traitMonoSpace) else { continue }
if !hasPrintedFamilyName {
hasPrintedFamilyName = true
robinkunde /
Last active Jul 12, 2018
Use this script to generate `configure` commands for static DHCP IP address assignment on EdgeRouter X
#!/usr/bin/env python3
import argparse
import os
import csv
usage = '''Use this script to generate configure commands.
Expected input csv format: identifier,identifier_suffix(optional),ignored,mac-address-with-dashes,ip4-address
First line is ignored.
View exportVisibleImages.swift
func exportVisibleImages() {
for (windowIndex, window) in {
let prefix = "iOS\(ProcessInfo.processInfo.operatingSystemVersion.majorVersion)_window\(windowIndex)_images"
exportImages(fromRootView: window, toDirectory: "/path/to/target/directory", prefix: prefix)
func exportImages(fromRootView rootView: UIView, toDirectory directory: String, prefix: String) {
let directoryURL = URL(fileURLWithPath: directory, isDirectory: true)
try! FileManager.default.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil)

When it comes to picking an analytics package for your mobile application, you have plenty of candidates to choose from: Google Firebase, Fabric, Hockeyapp, to just name a few.

These solutions vary in pricing and capabilities. However, the most important consideration for many clients is interoperability with existing analytics or business intelligence packages. For this reason, we often get requests to integrate the Google Analytics SDK into iOS and Android apps. If a mobile app’s structure hews closely to an existing website, the ability to use the same analytics suite for both allows us to easily unify reporting.

Google recently reorganized their Cocoapods offerings, moving components like their analytics package back into its own pod and deprecating the Google pod in the process.

It would have been a good time to redo their integration docs as well, but unfortunately, they are still outdated and incomplete.

I'd lik

BUNDLE_PATH=`xcrun simctl get_app_container booted $1`
if [[ $? -ne 0 ]]; then
exit 1
for f in $BUNDLE_PATH/*; do
open -R "$f"
robinkunde / generic_dispatch_lock.swift
Created Jul 18, 2016
View generic_dispatch_lock.swift
@inline(__always) func with<T>(queue: dispatch_queue_t, @autoclosure(escaping) get block: () -> T) -> T {
assert(dispatch_queue_get_label(queue) != dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), "Invoked dispatch_sync in a way that will deadlock")
var result: T!
dispatch_sync(queue) {
result = block()
return result
#!/usr/bin/env python3
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--start', type=int, help='Pass start timestamp to append run time to notification')
parser.add_argument('--apikey', type=str, help='Pushover API key (can also be implicitly defined as ENV variable in $PUSHOVER_API_KEY)', default=os.getenv('PUSHOVER_API_KEY', ''))
parser.add_argument('--userkey', type=str, help='Pushover user key (can also be implicitly defined as ENV variable in $PUSHOVER_USER_KEY)', default=os.getenv('PUSHOVER_USER_KEY', ''))
args = parser.parse_args()
robinkunde / gist:8425a7b0459760e3c5e6
Created Feb 29, 2016
View gist:8425a7b0459760e3c5e6
UIAccessibilityPostNotification(UIAccessibilityPauseAssistiveTechnologyNotification, UIAccessibilityNotificationVoiceOverIdentifier)
robinkunde /
Created Nov 30, 2015 — forked from brandonb927/
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
# Alot of these configs have been taken from the various places
# on the web, most from here
# Set the colours you can use
robinkunde /
Last active Aug 29, 2015
Bash script that checks expiration date of SSL certificates
DATE_STRING="1 months"
display_usage() {
echo "This script displays the expiration dates of the passed SSL certificates if they expire before a set date (defaults to one month from now)."
echo "See usage of the -d parameter of the date command on how to format the optional date string."
echo -e "\nUsage:\n$0 [-d \"DATE_STRING\"] FILE... \n"
You can’t perform that action at this time.