Skip to content

Instantly share code, notes, and snippets.

View desmondmc's full-sized avatar
🐢

Desmond McNamee desmondmc

🐢
View GitHub Profile
@desmondmc
desmondmc / ResultType.swift
Created March 22, 2017 14:25
Result Type Goodies
import RxSwift
import RxCocoa
enum Result<T>: ResultType {
case success(T)
case failure(Error)
var data: T? {
switch self {
case .success(let d):
@desmondmc
desmondmc / Keychain.swift
Created March 28, 2017 08:47
Simple String Key Value Access to iOS Keychain
import Foundation
import Security
private let SecClass: String = kSecClass as String
private let SecAttrService: String = kSecAttrService as String
private let SecAttrAccessible: String = kSecAttrAccessible as String
private let SecAttrGeneric: String = kSecAttrGeneric as String
private let SecAttrAccount: String = kSecAttrAccount as String
private let SecMatchLimit: String = kSecMatchLimit as String
private let SecReturnData: String = kSecReturnData as String
@desmondmc
desmondmc / .git-completion.bash
Created July 4, 2017 14:01
Git Autocompletion
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
# *) local and remote tag names
@desmondmc
desmondmc / name.json
Created July 11, 2017 15:40
Name JSON
{"name":"Desmond"}
@desmondmc
desmondmc / feedfm_example.swift
Created June 22, 2018 10:56
requestStations fails if initialize was called without a connection
func initialize(_ token: String, secret: String) {
FMAudioPlayer.setClientToken(token, secret: secret)
}
func requestStations(stationsCallback: (Stations) -> ()) {
FMAudioPlayer.shared().whenAvailable({
guard let stations = FMAudioPlayer.shared().getAllStations(options: [:]) else {
// throw error
return
}
@desmondmc
desmondmc / build.gradle
Last active September 11, 2019 07:27
Hemes enabled build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js",
enableHermes: true // clean and rebuild if changing
]
def jscFlavor = 'org.webkit:android-jsc:+'