Skip to content

Instantly share code, notes, and snippets.

View biorubenfs's full-sized avatar
🏠
Working from home

Ruben Fernandez biorubenfs

🏠
Working from home
View GitHub Profile
@biorubenfs
biorubenfs / .gitconfig
Created September 11, 2025 08:22
git config
[user]
name = xxx
email = xxx@xxx.com
[init]
defaultBranch = main
[branch]
sort = -commiterdate
[pull]
rebase = true
@biorubenfs
biorubenfs / clean_snap.sh
Created June 28, 2025 22:14
clean snap packages
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
@biorubenfs
biorubenfs / try-catch-wrapper.js
Last active September 10, 2025 14:56
try catch wrapper javascript
async function catchError<T> (promise: T): Promise<[T, null] | [null, T]> {
try {
const data = await promise
return [data, null]
} catch (error) {
return [null, error]
}
}
const [data, error] = await catchError(fetchUser())