Skip to content

Instantly share code, notes, and snippets.

View simonmitchell's full-sized avatar

Simon Mitchell simonmitchell

View GitHub Profile
public final class CardDismissHandler: NSObject {
final class DismissalPanGesture: UIPanGestureRecognizer {}
final class DismissalScreenEdgePanGesture: UIScreenEdgePanGestureRecognizer {}
lazy var dismissalPanGesture: DismissalPanGesture = {
let pan = DismissalPanGesture()
pan.maximumNumberOfTouches = 1
return pan
@simonmitchell
simonmitchell / a9ii_jpeg_stream
Created May 2, 2020 14:29
The RAW http stream that the Sony a9ii (Firmware 2.0) sends over WiFi
88 00 00 00 00 5e 00 00 10 00
00 00 78 00 00 00 0d 0a 37 38
0d 0a 65 00 00 00 00 00 00 00
01 00 00 00 00 00 00 00 02 00
00 00 00 00 00 00 00 00 00 00
03 00 00 00 03 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00
0a 00 00 80 07 00 00 00 00 00
00 00 00 00 00 00 0a 00 00 80
@simonmitchell
simonmitchell / Sunset Fo' Sure.xccolortheme
Created March 5, 2019 11:31
A nice (true) sunset theme for Xcode
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 12.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
@simonmitchell
simonmitchell / SubRanges.swift
Last active January 17, 2019 00:34
A swift algorithm for returning the list of sub-ranges required to access all items within a particular range from an array of "Countable" items (e.g. 2D array) given a range over the whole (The range as if the array was flatMapped). This is easier explained by examples, say we have 10 folders each with 5 files and we want to return files 10-20,…
/// A simple protocol for anything which has a count or length
protocol Countable {
var count: Int { get }
}
extension Array: Countable {
}
extension String: Countable {
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>ILCE-7M2</friendlyName>
<manufacturer>Sony Corporation</manufacturer>
<manufacturerURL>http://www.sony.net/</manufacturerURL>
@simonmitchell
simonmitchell / disasters.json
Created January 19, 2016 11:25
The full disasters.json when all disaster types are enabled for 3SidedCube's alerts API
[
{
"id": 1,
"name": {
"en": "Tsunami",
"es": "Tsunami "
},
"src": "cache://pages/5374942.json",
"image": "app://native/content/tsunami.png",
"events": [
@simonmitchell
simonmitchell / openssl-build.sh
Created November 21, 2015 15:03 — forked from Norod/openssl-build.sh
A shell script to build openssl for iOS and Mac. >>>>> It currently builds: Mac (i386, x86_64) >>>>> iOS (armv7, arm64) >>>>> iOS Simulator (i386, x86_64) >>>>> Updated to work with Xcode 7 and produce bitcode enabled binaries >>>>> Minimum deployment target can be easily configured
#!/bin/bash
# This script builds the iOS and Mac openSSL libraries with Bitcode enabled
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
# Doron Adler, GlideTalk, @Norod78