I hereby claim:
- I am renaudcerrato on github.
- I am renaudcerrato (https://keybase.io/renaudcerrato) on keybase.
- I have a public key ASABbJwczM3qvM1NIE5Nv6myqn1Ou-ypR6p5XFAcsvCf-Qo
To claim this, I am signing this object:
| #Requires -Modules NetAdapter | |
| #Requires -RunAsAdministrator | |
| <# | |
| .SYNOPSIS | |
| Conditionally sets or displays a specified advanced property of a network adapter. | |
| Filters adapters by keyword support. If no adapter name is given and a single | |
| matching adapter is found, it's selected automatically. Otherwise, it prompts. | |
| .DESCRIPTION |
| import kotlinx.coroutines.cancelAndJoin | |
| import kotlinx.coroutines.delay | |
| import kotlinx.coroutines.flow.Flow | |
| import kotlinx.coroutines.flow.channelFlow | |
| import kotlinx.coroutines.flow.map | |
| import kotlinx.coroutines.isActive | |
| import kotlinx.coroutines.launch | |
| import kotlinx.coroutines.sync.Mutex | |
| import kotlinx.coroutines.sync.withLock |
| #!/bin/sh | |
| error () { | |
| echo "error: $1" | |
| usage | |
| } | |
| usage () { | |
| echo "usage: $0 -u <username> -p <password> -d <domain> -i <seconds> <subdomain>"; | |
| exit 1 |
| #!/usr/bin/env bash | |
| KOTLIN=$(find . -name "*.kt" -exec cat {} \; | wc -l) | |
| JAVA=$(find . -name "*.java" -exec cat {} \; | wc -l) | |
| echo Kotlin: $KOTLIN lines \($(echo scale=2\; 100 \* $KOTLIN / \( $KOTLIN + $JAVA \) | bc -l)%\) | |
| echo Java : $JAVA lines \($(echo scale=2\; 100 \* $JAVA / \( $KOTLIN + $JAVA \) | bc -l)%\) | |
I hereby claim:
To claim this, I am signing this object:
| val list = listOf("Kotlin", "", "Java", "Groovy") | |
| fun main() { | |
| list.forEach { | |
| if(it.isNullOrEmpty()) return@forEach // return with implicit label | |
| println(it) | |
| } | |
| println("Done!") | |
| } |
| // Kotlin's standard library extension | |
| inline fun Array<String>.forEach(action: (String) -> Unit) { | |
| for(str in this) { | |
| action(str) | |
| } | |
| } | |
| val list = listOf("Kotlin", "Java", "Groovy") | |
| // a bare return statement in a lambda called from |
| inline fun greeter(action: () -> Unit) { | |
| try { | |
| println("Hello!") | |
| action() | |
| }finally{ | |
| println("Goodbye!") | |
| } | |
| } | |
| greeter { |
| // the returned value is the last expression of the try or catch block | |
| val a: Int? = try { parseInt(input) } catch (e: NumberFormatException) { null } | |
| fun printNumber(reader: BufferedReader) { | |
| val number = try { | |
| parseInt(reader.readLine()) | |
| } catch (e: NumberFormatException) { | |
| return | |
| } |
| enum class Direction { | |
| NORTH, SOUTH, WEST, EAST | |
| } | |
| enum class Color(val rgb: Int) { | |
| RED(0xFF0000), | |
| GREEN(0x00FF00), | |
| BLUE(0x0000FF) | |
| } |