Skip to content

Instantly share code, notes, and snippets.

View spinualexandru's full-sized avatar

Alex Spînu spinualexandru

View GitHub Profile
@spinualexandru
spinualexandru / npma.fish
Last active September 21, 2026 06:40
Fish function to append packages to npm allow-scripts. Like npm config set allow-scripts --location=user packageName but it appends instead of replacing.
function npma --wraps='npm config set allow-scripts' --description 'Append packages to npm allow-scripts'
if test (count $argv) -eq 0
printf 'Usage: npma PACKAGE [PACKAGE ...]\n' >&2
return 2
end
set -l current (npm config get allow-scripts --location=user)
or return
set -l allowed
@spinualexandru
spinualexandru / fnmi.fish
Created September 17, 2026 09:06
fnm install that keeps the previously installed global packages for linux
function fnmi --wraps='fnm install' --description 'Install Node with fnm and migrate global npm packages'
if not command -q fnm
echo 'fnmi: fnm is not installed or not on PATH' >&2
return 127
end
# Help should behave exactly like `fnm install --help` and have no side effects.
if contains -- --help $argv; or contains -- -h $argv
command fnm install $argv
return $status
@spinualexandru
spinualexandru / asus-rog-nkey-usbhid-v2.patch
Created September 1, 2026 10:41
asus-rog-nkey-usbhid-v2.patch
From: Ahmed Yaseen <yaseen@ghoul.dev>
Date: Fri, 28 Aug 2026 06:43:33 -0500
Subject: [PATCH v2] HID: usbhid: skip interrupt IN polling for devices with no input reports
usbhid starts polling a device's interrupt IN endpoint on open
(usbhid_open() -> hid_start_in()). If the report descriptor declares no
input reports there is nothing to read there, so the poll is useless,
and on some composite devices it is also harmful.
The ASUS ROG N-Key keyboards expose a second, input-less interface used
@spinualexandru
spinualexandru / gnome-keyring-merge.py
Created August 26, 2026 20:07
Safely copy one GNOME Keyring collection into another via libsecret.
#!/usr/bin/env python3
"""Safely copy one GNOME Keyring collection into another.
The source collection is never modified. Secret values, labels, and lookup
attributes are copied through libsecret and are never printed or written in
plaintext outside the destination keyring.
"""
from __future__ import annotations
import si from 'systeminformation';
import os from 'os';
// =============================================================================
// Interfaces & Data Schema
// =============================================================================
// Matches the system capabilities interface from your proposal.
interface SystemCapabilities {
cpu: {
#!/bin/bash
TERM_CLASS="dropdownkitty"
# Check if dropdown terminal exists
if ! pgrep -f "kitty --class $TERM_CLASS" > /dev/null; then
# Launch kitty with animation layer enabled (appears from top)
kitty --class $TERM_CLASS --title "Dropdown Terminal" &
# Wait for it to start
sleep 0.1
@spinualexandru
spinualexandru / matches.json
Created November 14, 2018 16:30
Matches Data
This file has been truncated, but you can view the full file.
{
"0": {
"date": "2018-11-17",
"team1": "BATE",
"team2": "Gorodeya",
"status": "Pending",
"country": "Belarus",
"league": "Cup"
},
"1": {
@spinualexandru
spinualexandru / test
Created September 1, 2018 08:58
Test
const test = 1;
if(test){
console.log(test);
}