This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:+' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"Desmond"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bash/zsh completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RxSwift | |
import RxCocoa | |
enum Result<T>: ResultType { | |
case success(T) | |
case failure(Error) | |
var data: T? { | |
switch self { | |
case .success(let d): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
indirect enum LinkedListNode<T> { | |
case value(element: T, next: LinkedListNode<T>) | |
case end | |
} | |
extension LinkedListNode: Sequence { | |
func makeIterator() -> LinkedListIterator<T> { | |
return LinkedListIterator(current: self) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension Sequence { | |
func scan<T>(_ seed: T, function:(T, Iterator.Element) -> T) -> T { | |
var current: T = seed | |
for element in self { | |
current = function(current, element) | |
} | |
return current | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
co = checkout | |
br = branch | |
st = status | |
visual = log --graph --full-history --all --pretty=format:%h%x09%d%x20%s | |
branch-name = !git rev-parse --abbrev-ref HEAD | |
publish = !git push -u origin $(git branch-name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
public protocol RequestConvertible { | |
var asRequest: NSMutableURLRequest { get } | |
} | |
enum NoDepsRouter: RequestConvertible { | |
case thing(id: String) | |
case postThings(id: String) |
NewerOlder