Skip to content

Instantly share code, notes, and snippets.

View wallentx's full-sized avatar
:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡

William Allen wallentx

:shipit:
ȋ̴͎ ̶̘͝u̷̥͆s̴͖̾ē̷̠ ̶̟̉a̴͙̕ŗ̸͆č̶̬ḣ̷̭ ̴̡̄b̷̳̒ẗ̷͍ẘ̴̡
View GitHub Profile
@wallentx
wallentx / .bash_functions
Created May 8, 2024 19:26
lol i tried to make a yaml parser in bash. it sorta works as long as you aren't trying to go beyond 2 nested levels
#######################
# YAML parser for BASH!
#######################
parse_yml() {
local prefix=$2
local s
local w
local fs
s='[[:space:]]*'
@wallentx
wallentx / dumploy.sh
Created May 8, 2024 02:39
A deployment bar that takes doodoos while its loading
#!/bin/bash
trap 'tput cnorm; echo' EXIT
tput civis
end=$(($(date +%s) + 15))
spin='⢿⣿⣻⣿⣽⣿⣾⣿⣷⣿⣿⣾⣿⣷⣿⣯⣿⣟⣿⡿⣿⢿⡿⣿'
i=0 sp="" len=24 cnt=0
gr=$(tput setaf 2)
nc=$(tput sgr0)
while [ $(date +%s) -lt $end ]; do
@wallentx
wallentx / info.sh
Created September 10, 2015 19:46
lemonbar stuff
#!/bin/sh
# info.sh
# Output information with formatted background colors in lemonbar format
# This script can take arguments for what bar information to display(meant to be the names of the functions)
# clickable area aliases
AC='%{A:' # start click area
AB=':}' # end click area cmd
AE='%{A}' # end click area
# %{R} # swap current bg/fg
@wallentx
wallentx / .env
Created March 7, 2024 03:09
generate gist descriptions for gists that have no description that currently costs way too many tokens, and sometimes provides shitty descriptions.
OPENAI_API_KEY=beans2000
GH_TOKEN=beans2001
@wallentx
wallentx / git-remote-protoswap
Last active March 7, 2024 00:33
Interactive Bash script for switching Git remote URLs between HTTPS and SSH protocols, utilizing `bashmenu.sh` for menu display.
#!/usr/bin/env bash
source <(curl -sL bashmenu.sh)
echo "Which protocol would you like to use?"
proto_opts=$(echo -e "https\nssh")
readarray -t protocols < <(echo "$proto_opts")
singleselect "false" result protocols -1
protocol="$result"
echo "You have selected: $protocol"
@wallentx
wallentx / gurl
Last active February 12, 2024 20:45
GNU URL
#!/bin/bash
# Initialize options
follow_redirects=false
show_headers_only=false
silence_output=false
# Process options
while getopts "LsI" opt; do
case $opt in
@wallentx
wallentx / caveget
Last active February 12, 2024 17:51
If a caveman had to make curl, or wget
#!/usr/bin/env bash
function cavemanget() {
local URL=$1
if [ "$URL" = "" ]; then
echo "A caveman version of wget"
echo "Usage: $0 \"URL\""
return 1
fi
@wallentx
wallentx / dropstreams.py
Last active January 30, 2024 09:47
List twitch streams that have drops enabled for a given --game_id (defaults to BattleBit Remastered game_id)
import argparse
import subprocess
import json
import re
# You need to have the `twitch-cli` installed and configured
# Define ANSI color codes
colors = {
@wallentx
wallentx / inkyImpression-watchButton
Last active January 28, 2024 22:00
Change image on button press - for the Inky Impression - 5.7", 7-color eInk display for the RPi
#!/usr/bin/env python3
import signal
import RPi.GPIO as GPIO
import subprocess
# Gpio pins for each button (from top to bottom)
BUTTONS = [5, 6, 16, 24]
# These correspond to buttons A, B, C and D respectively
@wallentx
wallentx / getbuilds
Last active December 26, 2023 19:26
#!/usr/bin/env bash
set -euo pipefail
download_dir="."
TMPOUT=$(mktemp /tmp/tmpXXXXXXXXXX)
Coff='\e[0m' # Off
Green='\e[0;32m' # Green
Blue='\e[0;34m' # Blue
Yellow='\e[0;33m' # Yellow