Skip to content

Instantly share code, notes, and snippets.

View BanHammerYKT's full-sized avatar
🏠
Working from home

Fedot Borisov BanHammerYKT

🏠
Working from home
  • JSB "Almazergienbank"
View GitHub Profile
@PlugFox
PlugFox / dart.code-snippets
Last active February 5, 2024 17:24
@dart-lang & @flutter Visual Studio Code snippets by @PlugFox
{
"Changelog unreleased": {
"scope": "md, markdown",
"prefix": "changelog_unreleased",
"description": "Changelog unreleased",
"body": [
"# Unreleased",
"+ added: ${0}",
"+ changed: ",
"+ deprecated: ",

Здравствуйте!

Для эмиграции в наше нелегкое время вам потребуются все документы, в том числе:

  • Загранпаспорт
  • Внутренний паспорт
  • ИНН (ХЗ зачем, "ну надо"©)
  • СНИЛС, Полис и прочие документы
  • Запасной работающий телефон (рекомендуется)

🇷🇺 Перед вылетом местным вылетом в другой город РФ:

@mjtiempo
mjtiempo / x0vncserver.service
Created November 24, 2022 02:42
TigerVNC systemd service using sddm on kde plasma
[Unit]
Description=Remote desktop service (VNC) for :0 display
Requires=display-manager.service
After=network-online.target
After=display-manager.service
[Service]
Type=simple
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment XAUTHORITY=$(find /var/run/sddm/ -type f)"
Environment=HOME=/root
@theapache64
theapache64 / adb.sh
Last active July 4, 2023 10:30
adb with device selection
function adb() {
# Execute the actual command
local totalLines=$(command adb devices | wc -l | xargs)
local totalDeviceConnected=$(expr $totalLines - 2)
if [[ "$@" != *"-s "* && $totalDeviceConnected -gt 1 ]]; then
# Get the list of connected devices
devices=(`command adb devices | awk '$2 == "device" {print $1}'`)
devicesText=""
@alaershov
alaershov / SharedEventFlow.kt
Created September 15, 2023 09:11
SharedEventFlow
/**
* Позволет эммитить сразу нескольким подписчикам все отправленные события.
* Ждёт, когда появится хотябы один подписчик, а затем отправляем ему все ивенты.
* credit: @aasitnikov
*/
class SharedEventFlow<T> : FlowCollector<T>, Flow<T> {
private val sharedFlow = MutableSharedFlow<T>()
override suspend fun emit(value: T) {

This gist provides a more flexible version of adb that exposes the functionality to select a device and then use that device's serial number in one or more adb commands. It expands on the initial implementation of the deeplinks.sh gist.

Companion blog post for usage is 🔗 here.

Companion posts for earlier versions of the script: Extending an Interactive ADB

package ru.pberdnik.example.core.di_extension
import co.touchlab.kermit.Logger
import com.arkivanov.decompose.ComponentContext
import com.arkivanov.decompose.ComponentContextFactory
import com.arkivanov.decompose.GenericComponentContext
import com.arkivanov.essenty.backhandler.BackHandlerOwner
import com.arkivanov.essenty.instancekeeper.InstanceKeeper
import com.arkivanov.essenty.instancekeeper.InstanceKeeperOwner
import com.arkivanov.essenty.instancekeeper.getOrCreate