Skip to content

Instantly share code, notes, and snippets.

View robinkunde's full-sized avatar

Robin Kunde robinkunde

View GitHub Profile
@robinkunde
robinkunde / hexEncodedStringFromData.m
Last active August 29, 2015 14:04
High performance function for creating hex encoded string from NSData
NSString *hexEncodedStringFromData(NSData *data)
{
static const char hexChars[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
// Store the length, otherwise it would be re-evalued on each loop iteration
NSUInteger length = data.length;
// malloc result data NULL terminated string
char *resultData = malloc(length * 2 + 1);
const unsigned char *sourceData = (const unsigned char *)data.bytes;
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
### Keybase proof
I hereby claim:
* I am robinkunde on github.
* I am robinkunde (https://keybase.io/robinkunde) on keybase.
* I have a public key whose fingerprint is 74B3 6554 9086 90BA A7C1 25B0 9491 BAB4 65E0 3C6B
To claim this, I am signing this object:
@robinkunde
robinkunde / ssl_cert_expiration.sh
Last active August 29, 2015 14:20
Bash script that checks expiration date of SSL certificates
#!/bin/bash
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"
}
@robinkunde
robinkunde / osx-for-hackers.sh
Created November 30, 2015 18:39 — forked from brandonb927/osx-for-hackers.sh
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...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@robinkunde
robinkunde / gist:8425a7b0459760e3c5e6
Created February 29, 2016 20:33
UIAccessibilityNotificationVoiceOverIdentifier
UIAccessibilityPostNotification(UIAccessibilityPauseAssistiveTechnologyNotification, UIAccessibilityNotificationVoiceOverIdentifier)
@robinkunde
robinkunde / generic_dispatch_lock.swift
Created July 18, 2016 19:47
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
}
@robinkunde
robinkunde / openSimFolderForBundleID.sh
Created July 19, 2017 19:13
openSimFolderForBundleID
#!/bin/bash
BUNDLE_PATH=`xcrun simctl get_app_container booted $1`
if [[ $? -ne 0 ]]; then
exit 1
fi
for f in $BUNDLE_PATH/*; do
open -R "$f"
exit;
#!/usr/bin/env python3
import os
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('message')
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
robinkunde / blog.md
Last active September 6, 2017 16:56

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