Skip to content

Instantly share code, notes, and snippets.

View xorspark's full-sized avatar
💻
Move every zig(lang). *groan*

Anthony P xorspark

💻
Move every zig(lang). *groan*
  • South Hadley, MA
View GitHub Profile
" Vim indent file
" Language: CFScript
" Last Change: 2014 February 12
" Version: 1.0
" License: Same as Vim.
" Gutted version of the Java.vim file. Quick and dirty, but it works.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
@xorspark
xorspark / basic_pomodoro.sh
Created August 27, 2021 02:15
Stream prompt was to make a pomodoro utility in pure bash and I needed a break from some JS insanity earlier today. I'll probably colorize it later and do some other fancy stuff at some point.
#!/usr/bin/bash
declare mins count colstart fmtmin fmtsec outp
mins="$1"
if [[ -z "$mins" ]]; then
printf 'Need a minute value.\n'
exit 1
fi
@xorspark
xorspark / twitch-mpv.sh
Last active September 18, 2021 16:14
Bash script to allow viewing twitch streams with mpv at the desired video encoding. Inspired by the twitch-view/twitch-format scripts but in pure bash instead of having a perl dependency.
#!/usr/bin/env bash
# Allows you to watch a twitch stream at the desired encoding rate
# using mpv + youtube-dl
twitch_name="$1"
if [[ -z "$twitch_name" ]]; then
printf "Error: twitch username required.\n"
exit 1
fi
@xorspark
xorspark / viewdroplr
Created March 5, 2022 18:39
View droplr content from the terminal
#!/bin/bash
# View droplr content from the terminal by extracting the content URL
# from the in-page JSON metadata
#
# Requires jq, feh and mpv
main() {
local url="$1"
local json_payload
local content_url
@xorspark
xorspark / yuno
Last active May 13, 2024 18:32
y U nO MoCk? Mocking text filter that I use from within vim. Because reasons.
#!/bin/bash
# makes mocking alt caps text from stdin
upper=0
while IFS= read -N 1 line; do
if [[ "$line" =~ [[:space::]] ]]; then
printf "%s" "$line"
elif (( upper == 0 )); then
printf "%s" "${line,}"
upper=1