Skip to content

Instantly share code, notes, and snippets.

View aciidgh's full-sized avatar

Ankit Aggarwal aciidgh

View GitHub Profile
import Foundation
struct StringCodingKey: CodingKey {
var stringValue: String
init(stringValue: String) {
self.stringValue = stringValue
}
var intValue: Int? { return nil }
init?(intValue: Int) { fatalError() }
}
@ddunbar
ddunbar / gist:c5058565691e0ec323d429994d77f9ba
Last active November 7, 2019 04:25
How I Configure My Kinesis
Enter Mac mode:
Hold =, press m.
The top four thumb keys while in Mac mode, from left to right are: Command | Option | Ctrl | Command
Enable Media keys:
Hold =, press n. If you have applied the remappings below, note that it is the *remapped* = (i.e. tab).
Disable key clicks:
Hold Progrm, press -/_ (disable beeps).
Hold Progrm, press |/\ (disable clicks).
@erica
erica / trim.swift
Last active December 29, 2015 02:05
internal extension CollectionType where Index: BidirectionalIndexType {
internal func _lastIndexOf(@noescape isElement: Generator.Element -> Bool) -> Index? {
for i in indices.reverse()
where isElement(self[i]) {
return i
}
return nil
}
}