Skip to content

Instantly share code, notes, and snippets.

View Matt-Deacalion's full-sized avatar
🏹
Ready, Fire, Aim!

Matt Matt-Deacalion

🏹
Ready, Fire, Aim!
  • Budapest, Hungary
View GitHub Profile
@jart
jart / rename-pictures.sh
Created December 12, 2023 15:24
Shell script for renaming all images in a folder
#!/bin/sh
# rename-pictures.sh
# Author: Justine Tunney <[email protected]>
# License: Apache 2.0
#
# This shell script can be used to ensure all the images in a folder
# have good descriptive filenames that are written in English. It's
# based on the Mistral 7b and LLaVA v1.5 models.
#
# For example, the following command:
@lifepillar
lifepillar / reactive-framework.vim
Created December 29, 2023 17:33
Building a Reactive Library from Scratch in Vim 9 Script
vim9script
# Translation into Vim 9 script of the tutorial at:
# https://dev.to/ryansolid/building-a-reactive-library-from-scratch-1i0p
# Helper functions and classes {{{
def IndexOf(items: list<any>, item: any): number
return indexof(items, (_, e) => e is item)
enddef
@digitalsignalperson
digitalsignalperson / bwrap-firefox.sh
Created January 25, 2024 03:16
Bubblewrapped firefox with a fifo on the host to open links inside the container
#!/bin/bash
URL_FIFO=$HOME/Downloads/ff_fifo
mkfifo "$URL_FIFO"
ffscript=$(mktemp)
cat > "$ffscript" << EOF
#!/bin/bash
echo "Creating profile"
@foriequal0
foriequal0 / github-spa-on-navigate.js
Created April 30, 2024 04:58
GitHub SPA listen navigation event
function onNavigate(listener) {
// GitHub uses Turbo for tab navigations.
// You can listen initial page load event, or subsequent tab navigations with this.
// https://turbo.hotwired.dev/reference/events#turbo%3Aload
window.addEventListener("turbo:load", listener);
// For the file/dir navigation, it emits following events to the document.
/*
export const SOFT_NAV_STATE = Object.freeze({
INITIAL: 'soft-nav:initial',
@ftk
ftk / Cargo.toml
Last active May 4, 2025 18:42
http mitm proxy. Simple http proxy to modify Range: http headers. Can be used to speed up youtube in mpv
# To generate mitm cert and key:
# openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -passout pass:"third-wheel" -subj "/C=US/ST=private/L=province/O=city/CN=hostname.example.com"
# see: https://github.com/campbellC/third-wheel
[package]
name = "http-ytproxy"
version = "0.1.0"
edition = "2021"
@ftk
ftk / notification-watch.sh
Last active October 10, 2024 13:27
check for one-time codes coming as notifications via KDE connect and copy them to clipboard
#!/usr/bin/env bash
# check for one-time codes coming as notifications via KDE connect and copy them to clipboard
# requirements: qdbus(qt-tools), dbus-monitor, kde-connect, klipper
# the script must be run in user session
set -euo pipefail
shopt -s lastpipe
if [[ $# -eq 0 ]]
then
@wolandark
wolandark / dict.vim
Created June 20, 2024 23:33
dict wrapper in vim9script. Gets word_under_cursor definition from wordnet and displays it in a split buffer
vim9script
def GetWord()
var word_under_cursor = expand('<cword>')
var result = system('dict -d wn ' .. word_under_cursor)
execute 'vnew'
setlocal buftype=nofile
setlocal bufhidden=hide
@sigzegv
sigzegv / vimrc
Last active March 2, 2025 18:45
vimrc for vim9+
vim9script
# https://vimhelp.org/vim9.txt.html
set nocompatible
if has("mac")
set clipboard=unnamed
else
set clipboard=unnamedplus # requires vim-gui-common
endif
@rusty-snake
rusty-snake / .gitignore
Last active October 20, 2024 13:36
Bypass seccomp-bpf based memory-deny-write-execute with `READ_IMPLIES_EXEC`
/target
@copyleftdev
copyleftdev / cheat-sheet.md
Created August 24, 2024 06:44
Ultimate Linux Terminal Tricks Cheatsheet

🚀 Ultimate Linux Terminal Tricks Cheatsheet

🧭 Navigation Ninja

Command Description
cd - 🔙 Teleport to previous directory
pushd <dir> 📚 Change directory, save current to stack
popd 📚 Return to most recently pushed directory
cd ~ 🏠 Go to home directory