Skip to content

Instantly share code, notes, and snippets.

@eddy-22
eddy-22 / tempmail.sh
Created December 6, 2024 21:46 — forked from xpepper/tempmail.sh
A shell script to create a temporary disposable email via command line (install w3m, curl, jq)
#!/usr/bin/env sh
#
# by Siddharth Dushantha 2020
#
# Dependencies: jq, curl, w3m
#
version=1.1.9
# By default 'tmpmail' uses 'w3m' as it's web browser to render
@eddy-22
eddy-22 / optparsing_demo.zsh
Created November 11, 2024 22:00
ZSH option parsing
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {
@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.