Skip to content

Instantly share code, notes, and snippets.

View epochblue's full-sized avatar

Bill Israel epochblue

View GitHub Profile
@epochblue
epochblue / rdio-export.py
Last active December 9, 2015 04:25
A quick-and-dirty script for getting all my album and playlist info out of Rdio before my subscription is up. This script was only tested on Python 3.5.0.
import requests
from requests.auth import HTTPBasicAuth
CLIENT_ID = ''
CLIENT_SECRET = ''
TOKEN_URL = 'https://services.rdio.com/oauth2/token'
API_URL = 'https://services.rdio.com/api/1/'
# GET TOKEN
@epochblue
epochblue / readlater.sh
Created October 16, 2015 02:27
A CLI-only read-later list.
#!/usr/bin/env bash
# readlater.sh -- a time waster by Bill Israel <bill.israel@gmail.com>
#
# Think of it as an overly simplified, text-based version of Instapaper
# without most of the cool features.
#
# The path to your read later file (I recommend it being a file in Dropbox)
RL_FILE="$HOME/Dropbox/readlater.txt"
Join the channel you want to register. Make sure you're an op (either the first to join, or someone who is an op there sets you to +o).
/join #newchannel
/msg chanserv register #newchannel
/msg chanserv set #newchannel mlock +cnt-s
/msg chanserv set #newchannel guard on
/msg chanserv set #newchannel secure on
/msg chanserv set #newchannel topiclock on
/msg chanserv set #newchannel keeptopic on
/msg chanserv set #newchannel url http://example.org/
@epochblue
epochblue / isitup.py
Last active August 29, 2015 14:13
Personal Pingdom
"""
Notify someone if a website is unavailable.
Usage:
isitup.py [-v] <site> <from_email> <to_email> <smtp_user> <smtp_password>
isitup.py -h|--help
isitup.py --version
Options:
-h --help Print this message
@epochblue
epochblue / get-img.py
Created December 12, 2014 22:31
Get all the image tags in a given URL and print their URLs.
import sys
import urllib2
import contextlib
from bs4 import BeautifulSoup
if len(sys.argv) < 2:
print 'Error: Please provide a URL to scrape.'
sys.exit(1)
@epochblue
epochblue / weather.py
Last active August 29, 2015 14:06
A simple script for retrieving current Nashville weather.
import os
import json
import urllib2
import contextlib
URL='http://api.openweathermap.org/data/2.5/weather?q=Nashville,TN&units=imperial'
with contextlib.closing(urllib2.urlopen(URL)) as r:
response = json.loads(r.read())
@epochblue
epochblue / hipchat-tuneage.py
Last active August 29, 2015 14:00
A small CLI app for changing the topic in a HipChat room to the currently playing song.
"""
An afternoon distraction by Bill Israel.
`hipchat-music.py` will send a notification to a HipChat chat room with the
artist and song title of the currently playing song. Supported music apps
include iTunes, Rdio, and Spotify.
_Note: This code uses v2 of the HipChat API._
Requirements:
@epochblue
epochblue / boom.sh
Last active September 20, 2021 11:14
A simple key-value "store" for use on the command line. Conceptually similar to Zach Holman's boom (https://github.com/holman/boom), but simpler and all in shell.
#!/usr/bin/env bash
# TODO: Document this
#
# AUTHOR: Bill Israel [https://github.com/epochblue]
# LICENSE: Public Domain
BOOMDB_DEFAULT="$HOME/.boomdb"
BOOMDB=${BOOMDB:=$BOOMDB_DEFAULT}
# Ensure the DB file exists
@epochblue
epochblue / fmr.sh
Created February 1, 2014 20:13
A command line utility for automatically generating PNG thumbnails and CMYK prints for http://framemyrun.com/
#!/usr/bin/env bash
# A command line utility for automatically generating PNG thumbnails and
# CMYK prints for http://framemyrun.com/
#
# Author: Bill Israel <bill.israel@gmail.com>
#
# LICENSE:
# This code is considered to be in the Public Domain. Use, copy, modify,
# distribute, sell, and do anything else you want with it. The author
@epochblue
epochblue / doneon
Last active December 27, 2015 04:49
A few add-ons for `todo.sh`: doneon: shows you items that were completed on a given date yesterday: shows you items that were completed yesterday edit: allows you to edit one of the todo.sh files without having to know its full path
#!/usr/bin/env bash
#
# Should be installed into $TODO_ACTIONS_DIR/doneon
# Note: be sure to make the script executable (chmod +x path/to/file)
#
action=$1
shift
function usage {