Skip to content

Instantly share code, notes, and snippets.

@mxalbert1996
mxalbert1996 / Scrollbar.kt
Last active July 16, 2024 13:41
Modifiers to draw scrollbars in Jetpack Compose
/*
* MIT License
*
* Copyright (c) 2022 Albert Chang
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@tkuenneth
tkuenneth / MainActivity.kt
Created May 29, 2021 10:07
How to display an adaptive icon in Jetpack Compose
package com.thomaskuenneth.sandbox
import android.graphics.Bitmap
import android.graphics.Canvas
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
@kralicky
kralicky / go-graph-download.sh
Last active July 4, 2024 20:27
Go graph download: recursive go mod download with all dependency versions
go mod graph | awk '{print $2}' | sort -u | xargs go mod download
@Skrilltrax
Skrilltrax / usb3-fastboot-fix.bat
Created May 27, 2020 18:02
Fix the USB 3 issues in fastboot
@Echo off
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f
pause
@Roliga
Roliga / hibernate-vm
Created April 14, 2020 12:00
Hibernate libvirt VM on host shutdown/sleep.
#!/bin/bash
#
# Usage: hibernate-vm NAME
#
# Hibernates the VM specified in NAME and waits for it to finish shutting down
#
if virsh dompmsuspend "$1" disk; then
echo "Waiting for domain to finish shutting down.." >&2
@m13253
m13253 / android-captive-portal-china-fix.sh
Created January 22, 2020 16:01
Change Android captive portal detection to Xiaomi's server
adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active July 22, 2024 17:46
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@superseb
superseb / cleanup.sh
Last active June 19, 2023 10:03
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
# OUTDATED: please refer to the link below for the latest version:
# https://github.com/rancherlabs/support-tools/blob/master/extended-rancher-2-cleanup/extended-cleanup-rancher2.sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@ashutosh-mishra
ashutosh-mishra / edit-init-rc.md
Last active July 3, 2024 20:15 — forked from azureru/extract android kernel.md
How to run custom script from init.rc, How to Extract Android Kernel And Modify The Boot Ramdisk(Android 4+)

init.rc changes

init.rc changes to run any script Can be used to start any android application, service

on property:dev.bootcomplete=1
    exec - system system -- /system/bin/sh <custom script path>
    # exec - system system -- /system/bin/sh /data/local/bootscript/testservice.sh

Script can contains applications start, stop commands

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 22, 2024 06:03
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example