Skip to content

Instantly share code, notes, and snippets.

View craigmaloney's full-sized avatar
👻
Anywhere but here.

Craig Maloney craigmaloney

👻
Anywhere but here.
View GitHub Profile
@craigmaloney
craigmaloney / groove
Created September 29, 2016 21:11
Groove Salad CLI
#!/bin/sh
mpg123 -b 1024 http://streamer-mtc-aa02.somafm.com:80/stream/1018 >> /home/craig/groove.log 2>&1
@craigmaloney
craigmaloney / scoreboard
Created September 28, 2016 16:43
Display todo.txt based on context (like a scoreboard)
#!/bin/bash
COMMAND="/home/craig/bin/todo.sh punch wh && echo && /home/craig/bin/todo.sh -@ ls"
TIME=2
watch --color --no-title -n $TIME $COMMAND $@
@craigmaloney
craigmaloney / load_styles.py
Last active August 29, 2015 14:09
Openpyxl style loader from YAML file
#!/usr/bin/env python
import yaml
from openpyxl.styles import (
Alignment,
Color,
PatternFill,
Font,
Border,
Side,
@craigmaloney
craigmaloney / combat.py
Created October 13, 2014 11:38
Grossly over-simplified D&D combat algorithm
#!/usr/bin/env python
import random
LARGE_SHORT_SWORD_DAMAGE = 8
def roll_d(die_size):
return random.randint(1, die_size)
@craigmaloney
craigmaloney / irc
Created June 11, 2013 16:54
Script to use for attaching or starting an IRC session with tmux and weechat
#!/bin/bash
if tmux has-session -t irc
then
tmux -2 attach -t irc
else
tmux -2 new -s "irc" weechat-curses
fi
@craigmaloney
craigmaloney / gist:1701305
Created January 29, 2012 23:19
Tagging for OGG and MP3 files, along with images
#!/usr/bin/env python
import eyeD3
from ogg import vorbis
from time import localtime
import json
import getopt
import sys
from email.mime.image import MIMEImage
def tag_mp3(target_file, info):