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
import java.nio.charset.StandardCharsets | |
import java.net.http.HttpClient | |
import java.net.http.HttpRequest | |
import java.net.http.HttpResponse | |
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) { | |
def taskName = "uploadSonatypePublication" | |
if (rootProject.tasks.names.contains(taskName) == false) { | |
rootProject.tasks.register(taskName) { | |
doLast { |
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
#!/usr/bin/env kotlin | |
/** | |
* Generates files and folders as they have been put in the folder. Envs uses common syntax, but | |
* values may contains {{${'$'}sampleVariable}} parts, where {{${'$'}sampleVariable}} will be replaced with variable value. | |
* Example: | |
* | |
* .env: | |
* sampleVariable=${'$'}prompt # require request from command line | |
* sampleVariable2=just some value | |
* sampleVariable3=${'$'}{sampleVariable}.${'$'}{sampleVariable2} |
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
import android.content.Context | |
import android.content.Intent | |
import android.os.Build | |
import android.os.Environment | |
import android.provider.Settings | |
import androidx.activity.result.contract.ActivityResultContract | |
import androidx.annotation.RequiresApi | |
@RequiresApi(Build.VERSION_CODES.R) | |
object RequestAccessToAllFilesContract : ActivityResultContract<Unit, Boolean>() { |
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 main(vararg args: String) { | |
val botToken = args.first() | |
val bot = telegramBot(botToken) | |
println(bot.getMe()) | |
} |
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 | |
function parse() { | |
version="$1" | |
while IFS= read -r line && [ -z "`echo "$line" | grep -e "^#\+ $version"`" ] | |
do | |
: # do nothing | |
done |
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
server { | |
listen 80 default_server; | |
server_name _; | |
return 301 https://$host$request_uri; | |
} |
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
import kotlinx.coroutines.channels.* | |
import kotlinx.coroutines.flow.* | |
@Suppress("FunctionName") | |
fun <T> BroadcastFlow( | |
internalChannelSize: Int = Channel.BUFFERED | |
): BroadcastFlow<T> { | |
val channel = BroadcastChannel<T>(internalChannelSize) | |
return BroadcastFlow( |
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 | |
rm ~/.config/monitors.xml* | |
exit 0 |
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
version: "3.4" | |
services: | |
grafana: | |
image: grafana/grafana | |
container_name: grafana | |
restart: always | |
volumes: | |
- "/path/host/grafana:/var/lib/grafana:rw" | |
environment: |
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 | |
function send_notification() { | |
notify-send -u low -i keyboard -c system "Shortcuts fixer" "$1" | |
} | |
function assert_success() { | |
"${@}" | |
local status=${?} | |
if [ ${status} -ne 0 ]; then |
NewerOlder