Skip to content

Instantly share code, notes, and snippets.

@moopet
moopet / keybase.md
Last active May 12, 2017 11:07
Keybase.io proof

Keybase proof

I hereby claim:

  • I am moopet on github.
  • I am moopet (https://keybase.io/moopet) on keybase.
  • I have a public key ASBDL0WstZWZFmw7idQIu28kRjxLgjZh_7A1ZRnwKVYjUwo

To claim this, I am signing this object:

@moopet
moopet / budgetrest.class.php
Created February 16, 2015 14:07
REST services for industrious 1980s executives on a budget.
<?php
class BudgetRest {
/**
*
*/
public function __construct() {
if (!empty($_SERVER['PATH_INFO'])) {
$sections = explode('/', trim($_SERVER['PATH_INFO'], '/'));
} elseif (!empty($_SERVER['REQUEST_URI']) && !empty($_SERVER['PHP_SELF'])) {
@moopet
moopet / skull.py
Last active December 19, 2015 10:49
Hack to let you locate and download mp3s using mp3skull.com as the search provider. mp3skull's HTML is basically a shit sandwich, so this is equally messy, but it does the trick.
#!/usr/bin/env python
# License: No.
# I am explicitly placing this in the public domain.
import sys
import re
import requests
import urllib
import urllib2
@moopet
moopet / now playing for squeezeboxes
Last active December 19, 2015 03:38
Just a quick hack to listen to xPL notifications and display them on screen. If you activate the xPL plugin on your squeezebox then you can get "now playing" popups. You can always replace pynotify with growl or whatever you use.
#!/usr/bin/env python
import select
import socket
import sys
import re
import pynotify
MAX_MESSAGE_SIZE = 1500
@moopet
moopet / mpc-guardian.sh
Created January 16, 2013 11:12
With a shared MPD server, sometimes other people will add shit music. Stop the rot.
#!/usr/bin/env bash
# Given a blacklist file with one pattern per line, automatically removes them from your playlist
# To nuke an artist or song just do something like:
#
# echo Nickleback >> /var/music/blacklist.txt
BLACKLIST=/var/music/blacklist.txt
MPD_HOST=localhost