Skip to content

Instantly share code, notes, and snippets.

@vganin
vganin / ComposeNumberPicker.kt
Last active January 14, 2024 11:53
Jetpack Compose simple number picker
@Composable
fun NumberPicker(
state: MutableState<Int>,
modifier: Modifier = Modifier,
range: IntRange? = null,
textStyle: TextStyle = LocalTextStyle.current,
onStateChanged: (Int) -> Unit = {},
) {
val coroutineScope = rememberCoroutineScope()
val numbersColumnHeight = 36.dp
@goofwear
goofwear / AdbCommands
Created October 15, 2020 04:16 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@Gowsky
Gowsky / Border.kt
Last active June 1, 2023 06:35
Corrected Modifier.border for Jetpack Compose. It adjusts inner rounded corner rectangle instead of using the same radius as outer rounded corner rectangle.
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Divider
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.geometry.*
@rinogo
rinogo / test-brisk.py
Created April 14, 2021 19:01
BRISK keypoint detection and brute force matching using OpenCV (Source: https://stackoverflow.com/a/65863713/114558)
# Imports
import cv2 as cv
import matplotlib.pyplot as plt
import sys
# Open and convert the input and training-set image from BGR to GRAYSCALE
image1 = cv.imread(filename = sys.argv[1],
flags = cv.IMREAD_GRAYSCALE)
image2 = cv.imread(filename = sys.argv[2],
@parthmistry
parthmistry / ReactorPrefetchProcessData.java
Created November 27, 2022 04:36
ReactorPrefetchProcessData
import reactor.core.publisher.Flux;
import reactor.core.publisher.FluxSink;
import java.sql.Connection;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
class PersonDataRetrieverForReactor implements Runnable {
@rumplestilzken
rumplestilzken / Rooting Your Unihertz Titan
Last active December 20, 2024 01:40
Rooting Your Titan
Unlock your Titan.
Obtain Magisk.apk [Magisk 25.2](https://github.com/topjohnwu/Magisk/releases/download/v25.2/Magisk-v25.2.apk)
Obtain Stock Rom
Extract Stock Rom and copy boot.img to your Titan.
Run Magisk on boot.img, make sure to include vbmeta patch. Do not check this for Titan Pocket and Titan Slim
Copy new Magisk boot.img to your computer
Boot into bootloader mode (adb reboot fastboot or Power + Volume Up while booting, once booted into recovery, if you get
a No Command screen, hold power and tap volume up, boot to bootloader)
fastboot flash boot magisk-boot.img
@thomasdarimont
thomasdarimont / MainMethodFinder.java
Last active March 7, 2025 22:51
Small tool to find classes with executable main methods in a given JDK.
import jdk.internal.org.objectweb.asm.*;
import java.io.*;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.*;
import java.util.concurrent.*;
import java.util.function.Consumer;
/**
@cbatson
cbatson / how-to-install-ifuse-on-macos.md
Last active April 23, 2025 06:01
How To Install ifuse on macOS (Updated Nov 2023)
@Kyle-Ye
Kyle-Ye / iPhone Mirroring.md
Last active March 20, 2025 11:27
Launch iPhone Mirroring.app on macOS 15 Beta 1