Skip to content

Instantly share code, notes, and snippets.

@npretto
npretto / universal-link-copy.user.js
Last active February 10, 2025 17:50
user script to copy link to the page as md
@npretto
npretto / metabase-dev.user.js
Last active June 11, 2025 13:26
handy userscript for working on metabase
/* eslint-disable no-color-literals */
// ==UserScript==
// @name Metabase dev stuff
// @namespace Violentmonkey Scripts
// @version 1.3
// @description Fills forms and do things
// @author Your Name
// @match *://*/*
// @grant GM_registerMenuCommand
// @grant GM_setValue
@npretto
npretto / automatic-node-pacakge-manager.sh
Created January 12, 2026 10:41
automatically detect yarn/bun/npm
# find package manager by looking for lockfiles in current and parent directories
function find-pkg-manager() {
local dir="$PWD"
while [ "$dir" != "/" ]; do
if [ -f "$dir/bun.lockb" ]; then
echo "bun|$dir/bun.lockb"
return 0
elif [ -f "$dir/pnpm-lock.yaml" ]; then
echo "pnpm|$dir/pnpm-lock.yaml"
return 0