Skip to content

Instantly share code, notes, and snippets.

View TBubba's full-sized avatar
🐜

Jesper Gustafsson TBubba

🐜
View GitHub Profile
@parkerlreed
parkerlreed / sort_playlist.sh
Last active November 29, 2018 00:30
Pass in playlist path as first argument and either --print (to print to terminal) or --save (to overwrite original file) as second.
#!/usr/bin/env bash
game_lookup() { grep -A 23 -r $1 Data/Platforms/ | grep Title | cut -d ">" -f 2 | cut -d "<" -f 1 | tail -1; }
game_list=$(for i in `grep '"id"' "$1" | tail -n +2 | cut -d "\"" -f 4`; do echo -n "$i "; game_lookup $i; done | sort -k 1.38 | cut -d " " -f 1)
playlist_file=$(
head -3 "$1"
for i in $game_list; do echo ' {
"id": "'$i'",
"notes": ""
},' ; done | sed '$ s/.$//'
tail -6 "$1")
@blixt
blixt / prng.js
Last active January 14, 2024 07:01
A very simple, seedable JavaScript PRNG. NOTE: Please read comments on why this is not a good choice.
// NOTICE 2020-04-18
// Please see the comments below about why this is not a great PRNG.
// Read summary by @bryc here:
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md
// Have a look at js-arbit which uses Alea:
// https://github.com/blixt/js-arbit
/**