Skip to content

Instantly share code, notes, and snippets.

View nouvist's full-sized avatar
✔️

Nouvistiardi nouvist

✔️
View GitHub Profile

My Scroll is Broken

Following AutoHotkey2 script will disable the broken wheel, and add scroll functionality on the middle button. Alt + MButton + drag the mouse up or down.

; disable wheels
*WheelUp:: return
*WheelDown:: return
@nouvist
nouvist / Suspend broke my EFI.md
Created February 28, 2024 17:49
suspend make my bios go boom and it's pricey to fix

How to Disable Suspend on Linux

Following systemctl command is written by Dustin Kirkland on askubuntu.com.

Disable

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
@nouvist
nouvist / Flutter Extensions.md
Last active May 25, 2024 18:42
Flutter Extensions

🎯 Epic Dart/Flutter Extensions Snippets

In JavaScript, messing with the native objects' prototypes is a bad idea. It can cause problems with third-party libraries that rely on it. But Dart have extension just like how C# does. It allows you to add new methods to existing classes without creating new derivatives nor modifying the original classes (like changing the prototype in JS). This is totally fine in Dart and C# and not a bad practice at all. I've made some Dart extensions snippets for myself and I want to share it here.

@nouvist
nouvist / rgb-hsl.frag
Created January 25, 2024 04:27
GLSL RGB-HSL Conversion
// Reference:
// https://stackoverflow.com/a/9493060/10940544
vec4 toHsl(vec4 rgb) {
float r = rgb.r;
float g = rgb.g;
float b = rgb.b;
float maxColor = max(max(r, g), b);
float minColor = min(min(r, g), b);
@nouvist
nouvist / Android Group Id.md
Last active May 28, 2023 10:02
Android Group Id

Android Group Id

Source: android_filesystem_config.h
GitHub AOSP mirror: android_filesystem_config.h

Name Id Description
AID_ROOT 0 traditional unix root user
AID_DAEMON 1 Traditional unix daemon owner.
AID_BIN 2 Traditional unix binaries owner.
AID_SYS 3 A group with the same gid on Linux/macOS/And
@nouvist
nouvist / build-rn-android.yml
Last active August 6, 2022 10:11
React Native Github Action
# Github Action for React Native Android
name: React Native Android
on:
workflow_dispatch:
inputs:
bundle:
type: boolean
default: false
@nouvist
nouvist / SSH Agent with Bash Profile.md
Last active August 6, 2022 10:09
SSH Agent with Bash Profile

⚠️ Use keychain instead, since that will setup the rest for you.

SSH Agent with Bash Profile

Add following script to your .bashrc or .zshrc.

# this will load existing pid and socket variable
source ~/.sshagent > /dev/null