Skip to content

Instantly share code, notes, and snippets.

/**
* url https://en.wikipedia.org/wiki/Blink_element
**/
setInterval(function(){
$('blink').each(function() {
$(this).toggle();
});
}, 250);
@c0des1ayr
c0des1ayr / filemap.sh
Last active July 13, 2025 03:46
Bash <4 mapfile implementation (works down to Bash 2.05b)
filemap(){ # custom back-compat implementation of mapfile bc why not
STRIP="f"
ARRAY_NAME=""
[[ $1 = "-t" ]] && STRIP="t" || ARRAY_NAME=$1
[[ $ARRAY_NAME = "" ]] && ARRAY_NAME=$2
LINENUM=0
for((;;)){
read -r || break
[[ $STRIP = "t" ]] && printf -v "$ARRAY_NAME[$LINENUM]" '%s' "${REPLY%"${_##*[!\\\n]}"}" || printf -v "$ARRAY_NAME[$LINENUM]" '%s' "$REPLY"
((LINENUM++))
@c0des1ayr
c0des1ayr / pushpop.py
Created February 10, 2025 00:23
`pushpop`, a simple pushd/popd implementation for Python scripts
import os
dir_stack = []
def pushd(new_dir):
dir_stack.append(os.getcwd())
os.chdir(new_dir)