Skip to content

Instantly share code, notes, and snippets.

@KlassenKonstantin
KlassenKonstantin / RubberBandSlider.kt
Created January 15, 2024 17:16
Rubber Band Slider Compose
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
WindowCompat.setDecorFitsSystemWindows(window, false)
super.onCreate(savedInstanceState)
setContent {
RubberBandSliderTheme {
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
Box(contentAlignment = Alignment.Center) {
RubberBandSlider(modifier = Modifier
.height(200.dp)
@raspberrypisig
raspberrypisig / CMakeLists.txt
Last active April 25, 2024 08:52
msys2 vscode integration c++ vcpkg cmake
cmake_minimum_required(VERSION 3.10)
project (roguelike-firststab)
set(SDL2_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/sdl2")
set(glad_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/glad")
set(lodepng-c_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/lodepng-c")
set(libtcod_DIR "C:/msys64/mingw64/bin/vcpkg/installed/x64-mingw-static/share/libtcod")
find_package(libtcod CONFIG REQUIRED)
add_executable(roguelike-firststab main.cpp)
target_link_libraries(roguelike-firststab PRIVATE libtcod::libtcod)
add_definitions(-DSDL_MAIN_HANDLED)
@briansp2020
briansp2020 / build_tf.sh
Created November 19, 2023 04:58
Build TensorFlow r2.14
#/bin/sh
cd
export HSA_OVERRIDE_GFX_VERSION=11.0.0
export PYTORCH_ROCM_ARCH="gfx1100"
export HIP_VISIBLE_DEVICES=0
export ROCM_PATH=/opt/rocm
echo "export HSA_OVERRIDE_GFX_VERSION=11.0.0" | tee --append .bashrc
echo "export PYTORCH_ROCM_ARCH=\"gfx1100\"" | tee --append .bashrc
echo "export HIP_VISIBLE_DEVICES=0" | tee --append .bashrc
echo "export ROCM_PATH=/opt/rocm" | tee --append .bashrc
@Pulimet
Pulimet / AdbCommands
Last active April 25, 2024 08:49
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
Big O complexities for common methods of Java Collections and common sorting algorithms.
Complexity (Best to Worst)
===================================================================================================
O(1) < O(log n) < O(n) < O(n log n) < O(n^2) < O(2^n) < O(n!)
Collections
===================================================================================================
@adcreare
adcreare / npm-beta-publish.md
Last active April 25, 2024 08:49
npm publish a beta package

Steps to publish a npm package to beta that won't be available via latest and won't auto install on ncu updates etc

  1. Ensure any compile is run npm run dist etc
  2. Modify version in package.json to the following format (match with existing verion numbers etc) "version": "0.1.120-beta.1" where beta.x is the number of those betas
  3. Publish to npm npm publish --tag beta

There are two options for install:

  • Always install beta with npm install packagename@beta
  • Install specific version with npm install package@0.1.120-beta.1
@MariusHerget
MariusHerget / analyze_snowflake_logs.py
Last active April 25, 2024 08:48 — forked from Allstreamer/snow.py
An advanced script to summarize a Snowflake(Tor Project) Log file with the corresponding docker compose file
# This Script uses the following dependancies
# pip install nums-from-string
# pip install datetime
#
# To Run this script type:
# python analyze_snowflake_logs.py <Log File Name>
#
# The default <Log File Name> is ./docker_snowflake.log
#
# Example:
@phobos-
phobos- / diamondf4_vtx_led_setup.txt
Last active April 25, 2024 08:44
DiamondF4 VTX LED setup
feature LED_STRIP
led 0 0,0::CV:0
led 1 1,0::CV:0
led 2 0,0::C:0
led 3 0,0::C:0
led 4 0,0::C:0
led 5 0,0::C:0
led 6 0,0::C:0
led 7 0,0::C:0
led 8 0,0::C:0
@osipxd
osipxd / paper-versions.json
Last active April 25, 2024 08:44
Paper versions links
{
"latest": "1.20.4",
"versions": {
"1.20.4": "https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/484/downloads/paper-1.20.4-484.jar",
"1.20.2": "https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/318/downloads/paper-1.20.2-318.jar",
"1.20.1": "https://api.papermc.io/v2/projects/paper/versions/1.20.1/builds/196/downloads/paper-1.20.1-196.jar",
"1.20": "https://api.papermc.io/v2/projects/paper/versions/1.20/builds/17/downloads/paper-1.20-17.jar",
"1.19.4": "https://api.papermc.io/v2/projects/paper/versions/1.19.4/builds/550/downloads/paper-1.19.4-550.jar",
"1.19.3": "https://api.papermc.io/v2/projects/paper/versions/1.19.3/builds/448/downloads/paper-1.19.3-448.jar",
"1.19.2": "https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar",
<!DOCTYPE html>
<html>
<head>
<style>
.editor { font-family: 'Roboto Mono', monospace; font-size: 12px; outline: none; overflow-y: auto; padding-left: 48px; counter-reset: line; }
.editor div { display: block; position: relative; white-space: pre-wrap; }
.editor div::before { content: counter(line); counter-increment: line; position: absolute; right: calc(100% + 16px); opacity: 0.5; }
</style>
</head>