Skip to content

Instantly share code, notes, and snippets.

View MLKrisJohnson's full-sized avatar

Kris Johnson MLKrisJohnson

View GitHub Profile
@rickmark
rickmark / CoreDevice.framework
Last active December 28, 2023 07:36
Apple's Remote Pairing and App Tampering APIs
@protocol NSSecureCoding <NSCoding>
// class methods
+[NSSecureCoding supportsSecureCoding]
@end
@protocol NSCoding
// instance methods
-[NSCoding encodeWithCoder:]
-[NSCoding encodeWithCoder:]
@mayoff
mayoff / FormatOptions.swift
Last active February 10, 2017 05:16
Avoiding duplication of property names
// For https://twitter.com/nicklockwood/status/819938181483233285
protocol Withable {
init()
}
extension Withable {
func with(_ body: (inout Self) -> ()) -> Self {
var copy = self
body(&copy)
@MLKrisJohnson
MLKrisJohnson / dechex.sh
Last active August 26, 2016 02:22
Bash/zsh functions for converting command-line arguments between decimal and hex
d2x() {
printf "%x\\n" $1
}
x2d() {
echo $((16#$1))
}
//
// SimpleScrollingStack.swift
// A super-simple demo of a scrolling UIStackView in iOS 9
//
// Created by Paul Hudson on 10/06/2015.
// Learn Swift at www.hackingwithswift.com
// @twostraws
//
import UIKit
@songzhou21
songzhou21 / gist:f08ae73f917d2d81f835
Last active April 1, 2022 07:13 — forked from gereon/gist:3150445
Spotlight search source files

Mac OSX Spotlight Enhancement

Add this to Info.plist in /System/Library/Spotlight/RichText.mdimporter/Contents/ and Spotlight will search for source code files.

<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
@natecook1000
natecook1000 / NSTimer+Closure.swift
Last active January 6, 2024 07:23
Scheduled NSTimer with a Swift closure
extension NSTimer {
/**
Creates and schedules a one-time `NSTimer` instance.
- Parameters:
- delay: The delay before execution.
- handler: A closure to execute after `delay`.
- Returns: The newly-created `NSTimer` instance.
*/
@JessicaSachs
JessicaSachs / screenshot_ex.py
Last active May 19, 2024 23:56
Taking Screenshots with Appium in Python
'''
Taking Screenshots with Appium
I'll be using Python and a sample iOS application from Apple's Developer Library
This tutorial assumes you understand how to run, launch, and interact with your application.
'''
from appium import webdriver
import os
@atd-schubert
atd-schubert / starter.sh
Created April 9, 2013 12:53
Solution for starting ArgoUML in Mac OSX Mountain Lion
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Starting with Mountain Lion start helper"
$DIR/JavaApplicationStub &