Skip to content

Instantly share code, notes, and snippets.

@RobJDavey
RobJDavey / Dictionary.swift
Last active August 29, 2015 14:14
Add two swift dictionaries together into a new optional dictionary, result is nil if there were conflicting keys
func +<Key, Value>(lhs: [Key: Value], rhs: [Key: Value]) -> [Key: Value]? {
var result = lhs
for (key, value) in rhs {
if contains(lhs.keys, key) {
return nil
}
result[key] = value
}
return result
}
@RobJDavey
RobJDavey / Regional-Identifiers.txt
Last active April 19, 2017 12:40
ISO Country Codes with Regional Identifiers
AC: 🇦🇨 Ascension Island
AD: 🇦🇩 Andorra
AE: 🇦🇪 United Arab Emirates
AF: 🇦🇫 Afghanistan
AG: 🇦🇬 Antigua & Barbuda
AI: 🇦🇮 Anguilla
AL: 🇦🇱 Albania
AM: 🇦🇲 Armenia
AO: 🇦🇴 Angola
AQ: 🇦🇶 Antarctica
@RobJDavey
RobJDavey / Emoji-Range.txt
Last active August 29, 2015 14:18
Current Unicode emoji range with skin tone modifier where applicable (OS X 10.10.3 / iOS 8.3)
1F300: 🌀
1F301: 🌁
1F302: 🌂
1F303: 🌃
1F304: 🌄
1F305: 🌅
1F306: 🌆
1F307: 🌇
1F308: 🌈
1F309: 🌉
@RobJDavey
RobJDavey / Skin-Tone-Emoji.txt
Created April 11, 2015 00:07
All the emoji that currently supports the skin tone modifier (OS X 10.10.3 / iOS 8.3)
🎅🎅🏻🎅🏼🎅🏽🎅🏾🎅🏿
🏃🏃🏻🏃🏼🏃🏽🏃🏾🏃🏿
🏄🏄🏻🏄🏼🏄🏽🏄🏾🏄🏿
🏇🏇🏻🏇🏼🏇🏽🏇🏾🏇🏿
🏊🏊🏻🏊🏼🏊🏽🏊🏾🏊🏿
👂👂🏻👂🏼👂🏽👂🏾👂🏿
👃👃🏻👃🏼👃🏽👃🏾👃🏿
👆👆🏻👆🏼👆🏽👆🏾👆🏿
👇👇🏻👇🏼👇🏽👇🏾👇🏿
👈👈🏻👈🏼👈🏽👈🏾👈🏿

Keybase proof

I hereby claim:

  • I am robjdavey on github.
  • I am robjdavey (https://keybase.io/robjdavey) on keybase.
  • I have a public key whose fingerprint is FF91 C71F 084F ABCC 1895 CA78 6547 8691 5861 0EC9

To claim this, I am signing this object:

@RobJDavey
RobJDavey / CodingKeyType.swift
Last active August 29, 2015 14:23
Using Swift Protocol Extensions for strongly typed coding
protocol CodingKeyType {
typealias CodingKey: RawRepresentable
}
extension CodingKeyType where Self: NSCoding, CodingKey.RawValue == String {
static func decodeObject<T: AnyObject>(inout objv: T?, fromCoder aDecoder: NSCoder, forKey key: CodingKey) {
guard let object = aDecoder.decodeObjectOfClass(T.self, forKey: key.rawValue) as? T? else {
fatalError("Failed to decode a value of type \(T.self)")
}
@RobJDavey
RobJDavey / U1F300.txt
Last active January 16, 2018 22:44
OS X Emoji (with names from 10.11.4)
Miscellaneous Symbols and Pictographs
🌀️ = [1F300] CYCLONE
🌁️ = [1F301] FOGGY
🌂️ = [1F302] CLOSED UMBRELLA
🌃️ = [1F303] NIGHT WITH STARS
🌄️ = [1F304] SUNRISE OVER MOUNTAINS
🌅️ = [1F305] SUNRISE
🌆️ = [1F306] CITYSCAPE AT DUSK
🌇️ = [1F307] SUNSET OVER BUILDINGS
@RobJDavey
RobJDavey / common-crypto.h
Last active June 26, 2023 12:48
Using CommonCrypto in a Swift Script
#include <CommonCrypto/CommonCrypto.h>
#include <CommonCrypto/CommonRandom.h>
@RobJDavey
RobJDavey / all-codes
Last active August 3, 2016 23:33
All possible combinations of two-letter regional identifiers
AA: 🇦🇦
AB: 🇦🇧
AC: 🇦🇨 Ascension Island
AD: 🇦🇩 Andorra
AE: 🇦🇪 United Arab Emirates
AF: 🇦🇫 Afghanistan
AG: 🇦🇬 Antigua & Barbuda
AH: 🇦🇭
AI: 🇦🇮 Anguilla
AJ: 🇦🇯
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Rob Davey",
"label": "Software Engineer",
"summary": "I'm a full stack developer that has worked in the EDI industry for the last 7 year, and have just started my own company deliverying exciting new supply chain integration products.",
"email": "telefax.axiom-0n@icloud.com",
"url": "https://robjdavey.com",
"image": "https://avatars.githubusercontent.com/u/884913",
"location": {