I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
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 com.facebook.react.bridge.Arguments | |
import com.facebook.react.bridge.WritableArray | |
import com.facebook.react.bridge.WritableMap | |
fun writableMapOf(vararg values: Pair<String, *>): WritableMap { | |
val map = Arguments.createMap() | |
for ((key, value) in values) { | |
when (value) { | |
null -> map.putNull(key) | |
is Boolean -> map.putBoolean(key, value) |
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
/** Set the View visibility to VISIBLE and eventually animate the View alpha till 100% */ | |
fun View.visible(animate: Boolean = true) { | |
if (animate) { | |
animate().alpha(1f).setDuration(300).setListener(object : AnimatorListenerAdapter() { | |
override fun onAnimationStart(animation: Animator) { | |
super.onAnimationStart(animation) | |
visibility = View.VISIBLE | |
} | |
}) | |
} else { |
Deprecated: see https://github.com/deargle/island-vNext instead
- set up the nginx-proxy docker-compose. pull down nginx.tmpl.
- This will give auto letsencrypt
- git clone discourse into
/home/deargle/island
, drop in the two container config files below. Build them using the discourselauncher
- git clone the discourse-cas repo,
up
that.
Alamofire is a great Swift library developed by the creator of AFNetworking @mattt. The purpose of this gist is to explain how to use the built-in power of Alamofire to serialize your JSON. In this example we will be serializing a simple blog API. First we will start with serializing a single JSON object and add complexity as we go along.
This is the first JSON object that we will be serializing.
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
typealias ServiceResponse = (NSDictionary?, NSError?) -> Void | |
class DataProvider: NSObject { | |
var client:AFHTTPRequestOperationManager? | |
let LOGIN_URL = "/api/v1/login" | |
class var sharedInstance:DataProvider { | |
struct Singleton { | |
static let instance = DataProvider() |