Skip to content

Instantly share code, notes, and snippets.

Score_Under ScoreUnder

Block or report user

Report or block ScoreUnder

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ScoreUnder
ScoreUnder / lowstate_dep_graph.py
Created Nov 22, 2017
Convert salt lowstate to graphviz format
View lowstate_dep_graph.py
#!/usr/bin/env python3
import itertools
import yaml
import sys
class MultiDict(dict):
def add(self, key, value):
if key not in self:
self[key] = []
self[key].append(value)
@ScoreUnder
ScoreUnder / discord.js
Last active Apr 6, 2017 — forked from kuntau/discord.js
Hide Discordapp channel sidebar
View discord.js
//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', '');
@ScoreUnder
ScoreUnder / fw.py
Last active Mar 28, 2017 — forked from ZirconiumX/fw.py
What is this "readability" you speak of?
View fw.py
for l in __import__('fileinput').input():print(*[((c,chr(ord(c)+65248))[ord(c)<127]," ")[c==" "]for c in l[:-1]],sep='')
@ScoreUnder
ScoreUnder / fw
Last active May 2, 2017
Halfwidth-to-fullwidth text converter
View fw
perl -CS -Mutf8 -pe'y/ !-~/ !-~/'
@ScoreUnder
ScoreUnder / osrs-ping.pl
Created Sep 26, 2016
OSRS world ping checker
View osrs-ping.pl
@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 / lock.sh
Created Sep 22, 2016
Lock entire computer on linux with vlock
View lock.sh
sudo openvt -s -- sh -c "sudo -u charles -- vlock -a; chvt $(fgconsole)"
@ScoreUnder
ScoreUnder / hash
Created Sep 19, 2016
Naive hash code functions for creating terminal colours
View hash
#!/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 / git-log1
Created Mar 9, 2016
"git log1" script
View git-log1
#!/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 / skulldl
Last active Aug 29, 2015
skullmp3 downloader gui thing
View skulldl
#!/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"
View 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)")
You can’t perform that action at this time.