Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

James Tomasino jamestomasino

🎯
Focusing
View GitHub Profile
@jamestomasino
jamestomasino / bashrc.insults
Created Mar 22, 2019
bash insult on error
View bashrc.insults
# source this as part of your bash startup scripts
suicidePostCommand() {
if [ $? -ne 0 ]; then
local INSULT
INSULT[0]="Just what do you think you're doing Dave?"
INSULT[1]="It can only be attributed to human error."
INSULT[2]="That's something I cannot allow to happen."
INSULT[3]="My mind is going. I can feel it."
INSULT[4]="Sorry about this, I know it's a bit silly."
@jamestomasino
jamestomasino / tokipona.json
Last active Jul 15, 2018
Flashleit Set - Toki Pona Vocabulary
View tokipona.json
{
"front": "----------------------------------------\n- -\n- -\n- Mi -\n- -\n- -\n----------------------------------------\n",
"back": "----------------------------------------\n- -\n- -\n- Me/My -\n- -\n- -\n----------------------------------------\n",
"level": 1,
"lastReviewed": null
},
{
"front": "----------------------------------------\n- -\n- -\n- Sina -\n- -\n- -\n----------------------------------------\n",
"back": "-------------------------------
@jamestomasino
jamestomasino / history-commands.txt
Created May 7, 2018
Commands in history file with at least 2 uses
View history-commands.txt
1777 git
1511 ls
908 cd
863 vim
612 fe
322 z
289 make
287 gs
193 rm
176 cdroot
@jamestomasino
jamestomasino / sdf-update-gopher
Created Apr 29, 2018
Update script to mirror my gopher repo on SDF, updating relative links
View sdf-update-gopher
#!/usr/bin/env bash
# Config
GOPHER_DIR="/ftp/pub/users/tomasino/"
GOPHERMAP="${GOPHER_DIR}/gophermap"
# Overrides
pushd () {
command pushd "$@" > /dev/null
}
@jamestomasino
jamestomasino / center.awk
Last active Mar 25, 2018
center a file of text visually in the terminal (for ascii art)
View center.awk
#!/usr/bin/awk -f
BEGIN {
"tput cols" | getline c
while(getline < ARGV[1])
{
if(length>l){l=length}
}
w=(c-l)/2
}
@jamestomasino
jamestomasino / vcard-to-contact.awk
Created Mar 21, 2018
Generate contact files from vcard download
View vcard-to-contact.awk
# to run: awk -f vcard-to-contact.awk vcard-file.vcf
BEGIN {
FS = ";"
}
/BEGIN:VCARD/ {
# new contact, reset variables
c_n = ""
c_fn = ""
@jamestomasino
jamestomasino / stream.sh
Created Mar 10, 2018
Create stream to anonradio openmic (or local test) from any directory of mp3s
View stream.sh
#!/usr/bin/env bash
find . -name "*.mp3" -print | sort > "tracks.pls"
if [[ "$1" == "openmic" ]]; then
liquidsoap 'output.icecast(%mp3(bitrate=192), host="anonradio.net", port=8010, user="openmic", password="<password>", mount="/openmic", mksafe(playlist.once("tracks.pls")))'
else
liquidsoap 'out(playlist.once("tracks.pls"))'
fi
function finish {
@jamestomasino
jamestomasino / SMBDIS.ASM
Created Oct 17, 2017 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
View SMBDIS.ASM
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
View batchrename.sh
#!/usr/bin/env bash
set -e
ROOT="/home/tomasino/movies"
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
# First loop to rename files
View vscode-user-settings
{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 14,
"editor.renderControlCharacters": true,
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.autoClosingBrackets": false,
"editor.lineNumbers": "relative",
"editor.rulers": [
You can’t perform that action at this time.