Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xorspark's full-sized avatar
💻
Python, React, TypeScript and Go until my head asplode.

Anthony P xorspark

💻
Python, React, TypeScript and Go until my head asplode.
  • South Hadley, MA
View GitHub Profile
@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 / 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 / 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
" 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