This file contains hidden or 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
dependencies { | |
… | |
compile "org.jetbrains.kotlinx:kotlinx-coroutines-android:0.22.5" | |
} |
This file contains hidden or 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
kotlin.coroutines=enable |
This file contains hidden or 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
fun launch(block: suspend () -> Unit): Job |
This file contains hidden or 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
suspend fun delay( | |
time: Long, | |
unit: TimeUnit) { | |
… | |
} |
This file contains hidden or 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
launch { | |
delay(1000L) | |
println("World!") | |
} |
This file contains hidden or 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
launch { | |
delay(1000L) | |
println("World!") | |
} | |
println("Hello,") | |
Thread.sleep(2000L) |
This file contains hidden or 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
#!/bin/bash | |
# Usage ./password Name_Of_The_Wi-Fi_Network | |
# This script returns the password of the wireless SSID in input | |
echo "Wi-Fi SSID: $1" | |
ESCAPED=$(echo $1 | sed "s/'/\\\'/g" | sed "s/[ ]/\\\\ /g") | |
sudo security find-generic-password -ga ${ESCAPED} | sed -n -e 's/^.password: //p' |
This file contains hidden or 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
@file:JvmName("RotationTestUtils") | |
package com.your.package. | |
import android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE | |
import android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT | |
import android.content.res.Configuration | |
import android.content.res.Configuration.ORIENTATION_PORTRAIT | |
import android.support.test.InstrumentationRegistry | |
import android.support.test.rule.ActivityTestRule |
This file contains hidden or 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
String networkSSID = "Your Network SSID here"; | |
String networkPasskey = "YourNetworkPasswordHere"; | |
WifiConfiguration wifiConfiguration = new WifiConfiguration(); | |
wifiConfiguration.SSID = "\"" + networkSSID + "\""; | |
wifiConfiguration.preSharedKey = "\"" + networkPasskey + "\""; | |
WifiManager manager = (WifiManager) getSystemService(WIFI_SERVICE); | |
manager.addNetwork(wifiConfiguration); |
This file contains hidden or 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
@Module | |
public class AuthenticationModule { | |
@Provides | |
@Singleton | |
public AuthenticationService provideAuthenticationService(UserRepository userRepository) { | |
return new AuthenticationController(userRepository); | |
} | |
} |