Skip to content

Instantly share code, notes, and snippets.

View ScoreUnder's full-sized avatar

score ScoreUnder

View GitHub Profile

Keybase proof

I hereby claim:

  • I am scoreunder on github.
  • I am score_under (https://keybase.io/score_under) on keybase.
  • I have a public key ASCi0wXu6-Pgv2r7_1nToPdKplVnkLTlR3Vm7SzVZ4BGUwo

To claim this, I am signing this object:

@ScoreUnder
ScoreUnder / pomfload
Last active August 29, 2015 14:01 — forked from xy4n/pomfload
#!/bin/sh
# Requires node.js: sudo pacman -Sy nodejs
if [ $# -lt 1 ]; then
echo "Usage: $(basename "$0") FILE [FILE...]" >&2
exit 1
fi
for f in "$@"; do
d=$(node -pe "JSON.parse(process.argv[1]).files[0].url" "$(curl -sS --progress-bar -F "files[]=@$f" http://pomf.se/upload.php)")
@ScoreUnder
ScoreUnder / skulldl
Last active August 29, 2015 14:27
skullmp3 downloader gui thing
#!/bin/sh
title="mp3skull downloader"
put() { eval 'printf %s\\n "$'"$1"'"'; }
music_dir=$(xdg-user-dir MUSIC || put HOME)
cleanup() {
ret=$?
rm -f -- "$cookie_jar"
@ScoreUnder
ScoreUnder / git-log1
Created March 9, 2016 17:35
"git log1" script
#!/bin/sh
exec git log --oneline --graph --format='%C(yellow)%h %C(bold blue)%an %C(reset)%s %C(green)%GG%C(yellow)%D' "$@"
@ScoreUnder
ScoreUnder / hash
Created September 19, 2016 09:08
Naive hash code functions for creating terminal colours
#!/bin/busybox sh
# Original code, slow, not sh-compatible
hashcode() {
local hash=0
local str="$1"X
while [ -n "$str" ]; do
ch="${str:0:1}"
hash=$(( ($hash * 173 + $(printf '%d' "'$ch")) % 256 ))
str="${str:1}"
done
@ScoreUnder
ScoreUnder / lock.sh
Created September 22, 2016 08:24
Lock entire computer on linux with vlock
sudo openvt -s -- sh -c "sudo -u charles -- vlock -a; chvt $(fgconsole)"
@ScoreUnder
ScoreUnder / osrs-ping.pl
Created September 26, 2016 23:29
OSRS world ping checker
@worlds = 1..94;
for (@worlds) {
# This would probably work on Windows with "-c1" changed to "-n 1"
open $pings[$_], '-|', qw/ping -c1/, "oldschool$_.runescape.com";
}
undef $/;
for (@pings[@worlds]) {
if (<$_> =~ /time=([\d.]+ ?ms)/) {
$_ = $1;
@ScoreUnder
ScoreUnder / fw
Last active May 2, 2017 11:58
Halfwidth-to-fullwidth text converter
perl -CS -Mutf8 -pe'y/ !-~/ !-~/'
@ScoreUnder
ScoreUnder / fw.py
Last active March 28, 2017 08:43 — forked from Ravenslofty/fw.py
What is this "readability" you speak of?
for l in __import__('fileinput').input():print(*[((c,chr(ord(c)+65248))[ord(c)<127]," ")[c==" "]for c in l[:-1]],sep='')
@ScoreUnder
ScoreUnder / discord.js
Last active April 6, 2017 09:25 — forked from kuntau/discord.js
Hide Discordapp channel sidebar
//ref: http://andrewhfarmer.com/hide-discord-sidebar/
var cmd$ = $;
document.addEventListener('keydown', function(event) {
if (event.metaKey && event.keyCode === 220) {
// Toggle visibility of the channel and guilds columns
var channelWrap = cmd$('.flex-vertical.channels-wrap');
var guildsWrap = cmd$('.guilds-wrapper');
var titleWrap = cmd$('.title-wrap');
if (channelWrap.getAttribute('style') === 'display: none') {
channelWrap.setAttribute('style', '');