Skip to content

Instantly share code, notes, and snippets.

@eddy-22
eddy-22 / select.sh
Created September 26, 2023 07:57
Bash Prompt for multiselect
#/bin/bash
# from SO: https://stackoverflow.com/a/54261882/317605 (by https://stackoverflow.com/users/8207842/dols3m)
function prompt_for_multiselect {
# little helpers for terminal print control and key input
ESC=$( printf "\033")
cursor_blink_on() { printf "$ESC[?25h"; }
cursor_blink_off() { printf "$ESC[?25l"; }
cursor_to() { printf "$ESC[$1;${2:-1}H"; }
print_inactive() { printf "$2 $1 "; }
@eddy-22
eddy-22 / example.zsh
Last active August 3, 2023 15:11 — forked from mattmc3/optparsing_demo.zsh
Zsh option parsing example
function yy() {
zmodload zsh/zutil
function breakout() { echo -e "$1" && exit 1}
local flag_url
local output="./%(artist)s/%(title)s.%(ext)s"
local flag_song
local flag_format='bestaudio[ext=m4a]'
@eddy-22
eddy-22 / audio-silence
Last active August 3, 2023 23:58
ffmpeg cheat sheet and useful scripts
#!/bin/sh
#===============================================================================
# audio-silence
# add silent audio to a video clip
#===============================================================================
# dependencies:
# ffmpeg ffprobe
@eddy-22
eddy-22 / docs.md
Last active May 13, 2023 11:37
[Pushshift] Reddit PMAW wrapper #pmaw #python

Pushshift Reddit API Documentation

NOTE: The fields paramater seems to not work, but replace it with filter

Academic Torrents Magnet Link

Preface

The pushshift.io Reddit API was designed and created by the /r/datasets mod team to help provide enhanced functionality and search capabilities for searching Reddit comments and submissions. The project lead, /u/stuck_in_the_matrix, is the maintainer of the Reddit comment and submissions archives located at https://files.pushshift.io.

@eddy-22
eddy-22 / Justfile
Created May 10, 2023 05:44
Example Makefile or Justfile rules for cleaning Python projects
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
@eddy-22
eddy-22 / bootstrap.sh
Last active May 20, 2023 10:20
A collection of cool stuff I came across regarding ZSH.
#!/usr/bin/env bash
@eddy-22
eddy-22 / awesome-mac-cli-apps.md
Created February 16, 2023 22:36
MacOS Cool Stuff

A curated list of useful command line apps, in celebration of the TUI.

“Knowledge brings fear” (Mars University Mission Statement)

Awesome

If you want to contribute, you are highly encouraged to do so. Please read the contribution guidelines.

@eddy-22
eddy-22 / error_handling.py
Created December 9, 2022 21:55 — forked from zachlagden/error_handling.py
pycord - Error handling useful code, because noone can remember everything :)
"""
Copyright (c) 2022, Zach Lagden
All rights reserved.
"""
import discord
from discord.ext import commands
from datetime import datetime
import coloredlogs
@eddy-22
eddy-22 / cloudflare-delete-all-records.sh
Created October 4, 2022 04:12 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
TOKEN="xxxxxxxxxxxxxxxxxxx"
ZONE_ID=2222222222222222222222222
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
@eddy-22
eddy-22 / github-actions-notes.md
Created September 16, 2021 02:22 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions