It's not as if you didn't know...
A Pen by Gerard Ferrandez on CodePen.
It's not as if you didn't know...
A Pen by Gerard Ferrandez on CodePen.
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
import android.database.Cursor; | |
import android.support.annotation.Nullable; | |
import android.support.v7.util.DiffUtil; | |
/** | |
* Created by Nikola on 9/29/2016. | |
*/ | |
public abstract class CursorCallback<C extends Cursor> extends DiffUtil.Callback { | |
private final C newCursor; |
import sys | |
import re | |
import dns.resolver # Requires dnspython | |
email_host_regex = re.compile(".*@(.*)$") | |
gmail_servers_regex = re.compile("(.google.com.|.googlemail.com.)$", re.IGNORECASE) | |
def is_gmail(email): | |
""" Returns True if the supplied Email address is a @gmail.com Email or is a Google Apps for your domain - hosted Gmail address | |
Checks are performed by checking the DNS MX records """ |
package com.my.app | |
import android.app.PendingIntent | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.hardware.usb.UsbDevice | |
import android.hardware.usb.UsbManager | |
import kotlinx.coroutines.experimental.CompletableDeferred |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this | |
val <T> T.` `: T get() = this |
This gist demonstrates how to build a Kotlin MPP library so that the iOS sourceSet
depends on and uses an iOS Framework as a dependency.
Key ideas:
./gradlew publishToMavenLocal
arm64
and x86_64
architectures, you can easily add arm32
if you need.cinterop
klib
artifact, allowing dependents to also know about the iOS Framework headers.You can find a gist explaining how to use such library in an iOS app [here][ios-app].