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 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 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 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 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 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 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 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 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 |
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
server { | |
server_name $HOST_NAME; | |
ssl_certificate $PATH_TO_PUBLIC_CERTIFICATE_PART; | |
ssl_certificate_key $PATH_TO_PRIVATE_CERTIFICATE_PART; | |
listen 443 ssl; | |
keepalive_timeout 60; | |
ssl on; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- Default colors --> | |
<color name="shadowBackgroundColor">#80aaaaaa</color> | |
<color name="positiveColor">#aa4caf50</color> | |
<color name="warningColor">#aaf2fd02</color> | |
<color name="negativeColor">#aaff0000</color> |
NewerOlder