Skip to content

Instantly share code, notes, and snippets.

View jnbdz's full-sized avatar
👨‍💻
None stop

JN Σ jnbdz

👨‍💻
None stop
View GitHub Profile
// Source: https://miloserdov.org/?p=2667
sudo swapoff /swapfile
sudo swapon --priority 100 /swapfile
#!/usr/bin/env bash
# Check for dependencies
if ! command -v fzf &> /dev/null; then
echo "fzf is required but it's not installed. Exiting."
exit 1
fi
locale="en_US"
locale=${locale%%_*} # Extract just the first part (e.g., "en" from "en_US")
name: Convert drawio to Image
on:
push:
paths:
- '**/*.drawio'
jobs:
convert:
runs-on: ubuntu-latest
#!/usr/bin/env bash
outputFile="config/manab_en.csv"
# Convert CSV to a simpler format and use fzf for searching
awk -F',' '{gsub(/"/, "", $1); gsub(/"/, "", $2); printf "%-15s %s\n", $1, $2}' "$outputFile" | fzf --ansi --preview-window=hidden:wrap
awk '{if (!match($0, /^[[:print:]\t\n\r]+$/)) print NR, $0}' ~/.bash_history
find bookmarks/ -type f -name "bookmarks.csv" -print0 | while IFS= read -r -d $'\0' file; do tail -n +2 "$file" | csvquote | awk -F "," '{ gsub(/^[ \t]+|[ \t]+$/, "", $2); print $2 }' | csvquote -u | sed 's/"//g'; done | grep -v '^\s*$' | fzf | xargs -r firefox
#!/bin/bash
# Your system locale, for example "en_US". You might dynamically get this with `echo $LANG` or `locale`.
locale="en_US"
locale=${locale%%_*} # Extract just the first part (e.g., "en" from "en_US")
# Find .desktop files that can handle HTTP/HTTPS and are not mimeinfo.cache
desktop_files=$(grep -rE "x-scheme-handler/(http|https)" /usr/share/applications/ ~/.local/share/applications/ | grep -E ".desktop:" | awk -F ":" '{ print $1 }' | sort -u)
# Create an associative array to hold appName => Exec mapping
name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
#!/bin/bash
podman run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21 go get
podman run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21 go build -v
#!/bin/bash
goVersion() {