Skip to content

Instantly share code, notes, and snippets.

bboe / parse_email_list.js
Last active Aug 12, 2021
Javascript email list parser with display name
View parse_email_list.js
function display_name(text) {
/* Remove all quotes
Remove whitespace, brackets, and commas from the ends. */
return text.replace(/(^[\s,>]+)|"|([\s,<]+$)/g, '');
function emails(addr_list) {
/* Regex source:
bboe /
Created Oct 17, 2014
Tool to interact with rabbitmq queues. Depends on docopt and pika (pip install docopt pika).
#!/usr/bin/env python
"""Usage: rabbit_admin [options] delete QUEUE
rabbit_admin [options] add QUEUE <KEY:VALUE>...
rabbit_admin [options] dump QUEUE
-D --not-durable don't use a durable queue
-h --help show this
-H --host HOST rabbitmq host [default: localhost]
bboe /
Created Jun 16, 2013
Saves all the available comments and submissions for a given user.
#!/usr/bin/env python
import cPickle
import praw
import sys
PERIODS = ['all', 'year', 'month', 'week', 'day', 'hour']
PERIOD_VIEWS = ['controversial', 'top']
VIEWS = [{'sort': x, 't': y} for x in PERIOD_VIEWS for y in PERIODS]
VIEWS.insert(0, {'sort': 'new'})
bboe /
Last active Dec 14, 2015
PyPi package deployment script. Depends on having an available pgp key to sign packages and the tag.
if [ $# -ne 1 ]; then
echo "Usage: $(basename $0) package_name"
exit 1
status=$(git status | head -n 1)
bboe / job_manager.c
Created Feb 23, 2012
Process-based Job Management in C
View job_manager.c
#include <errno.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include <sys/wait.h>
#include "job_manager.h"
volatile sig_atomic_t multiprocess_running = 0;
bboe /
Last active Jun 7, 2021
Python Reddit API Comment Loop Test
#!/usr/bin/env python3
import logging
import sys
import time
import praw
def configure_logging():
logger = logging.getLogger("praw")
bboe /
Created Oct 20, 2011
OSX Lion tether to Android script using Azilink and Tunnelblick
# azilink for OS X Lion
# based on but works with Tunnelblick only
# (no need to install a separate copy of OpenVPN2 from macports
# or building from source by hand, thankfully)
# Requires:
# - azilink running on android phone (
# (run the app and check the box to start the service).
# - adb on system path (comes with the Android SDK;
bboe /
Created Sep 22, 2011
Empty UCSB's umail inbox. Run via: ./ -u <USERNAME> -d
#!/usr/bin/env python
import getpass, imaplib, sys
from optparse import OptionParser
def main():
parser = OptionParser()
parser.add_option('-s', '--save', help='file to save contents to')
parser.add_option('-d', '--delete', action='store_true',
help='delete contents')