# Start a new session
tmux new -s <session>
# Run script inside session
bash ./script.sh
# Press CTRL+B then CTRL+D to detach from session
# Type exit to close session
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
| package ru.astrainteractive.klibs.kstorage.threading | |
| import kotlinx.atomicfu.atomic | |
| import kotlin.reflect.KProperty | |
| /** | |
| * A thread-safe, mutable variant of [Lazy] for Kotlin Multiplatform. | |
| * | |
| * The value is initialized on first access using [initializer] and can be reassigned later. | |
| * Safe for concurrent access across platforms (JVM, JS, Native). |
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
| @Composable | |
| fun ExtendedClickableBox( | |
| fakeBoxModifier: Modifier = Modifier, | |
| extraHitSize: Dp, | |
| content: @Composable () -> Unit | |
| ) { | |
| val extraHitSizePx = with( | |
| receiver = LocalDensity.current, | |
| block = { | |
| extraHitSize |
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 | |
| set -e | |
| # Temp download location | |
| cd /tmp | |
| # Download latest Discord tar.gz | |
| wget -O discord.tar.gz "https://discord.com/api/download?platform=linux&format=tar.gz" | |
| # Extract |
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
| is_installed() { | |
| local package="$1" | |
| if pacman -Qs "$package" > /dev/null; then | |
| echo "Package $package is installed" | |
| return 0 | |
| else | |
| echo "Package $package is not installed" | |
| return 1 | |
| fi | |
| } |
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
| from PIL import Image, ImageDraw | |
| import os | |
| import random | |
| import math | |
| import numpy as np | |
| # === НАСТРОЙКИ === | |
| ICONS_FOLDER = "icons" | |
| OUTPUT_IMAGE = "final_pattern.png" | |
| WIDTH, HEIGHT = 2000, 4000 |
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' | |
| # docker login -u <USERNAME> -p <PASSWORD> <URL> | |
| # docker buildx build -t <URL>/<IMAGE>:<VERSION> -f .Dockerfile . | |
| # docker tag <IMAGE>:<VERSION> <URL>/<IMAGE>:<VERSION> | |
| # docker push <VERSION>/<IMAGE>:<VERSION> | |
| # curl -u <USERNAME>:<PASSWORD> <URL>/v2/discordbot/tags/list | |
| # curl -u <USERNAME>:<PASSWORD> <URL>/v2/_catalog | |
| services: |
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
| -- Track if Command+Shift are both down | |
| local wasCmdShiftDown = false | |
| -- Function to switch language | |
| local function switchLanguage() | |
| local lay = hs.keycodes.currentLayout() | |
| print("Current layout:", lay) | |
| if lay == "ABC" then | |
| hs.keycodes.setLayout("Russian") | |
| else |
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
| public fun <T> Flow<T>.onLatest(action: suspend (T) -> Unit): Flow<T> = transformLatest { value -> | |
| action(value) | |
| return@transformLatest emit(value) | |
| } |
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
| services: | |
| # For command call use `docker exec mc_docker rcon-cli <your_command>` | |
| mc_docker: | |
| restart: no | |
| container_name: mc_docker | |
| image: itzg/minecraft-server # https://github.com/itzg/docker-minecraft-server | |
| tty: true | |
| stdin_open: true | |
| ports: | |
| - "25565:25565" |
NewerOlder