Skip to content

Instantly share code, notes, and snippets.


Owen oparrish

View GitHub Profile
oparrish /
Created Feb 10, 2015
Outputs current unread count, feed title, and publish date of last read item in your Feed Wrangler account
import requests
import json
import time
import sys
def get_feed(access_token, feed_id, offset=0, limit=1000, read='false', published_since='1'):
feed_payload = {'access_token': access_token, 'read': read, 'feed_id': feed_id, 'offset': offset, 'published_since': published_since, 'limit': limit}
feed_r = requests.get('', params=feed_payload)
feed_data = json.loads(feed_r.text)
oparrish /
Last active Dec 29, 2015
Output the duration for an M4A
import sys
from mutagen.mp4 import MP4
m4a_file = sys.argv[1]
m4a = MP4(m4a_file)
length_secs =
oparrish /
Created Nov 14, 2013
AutoKey ( script to open a new tab in Terminator with SSH to selected IP.
import subprocess
import re
host = clipboard.get_selection()
host = host.strip()
pattern = re.compile("^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$")
validHost = pattern.match(host)
if validHost:
oparrish / cue_to_html.rb
Last active Dec 26, 2015
Ruby script to format a CUE sheet as HTML output
View cue_to_html.rb
require 'rubycue'
require 'optparse'
options = {}
opts = do |opts|
opts.on("-c", "--cue PATH", "Path to chesheet file") do |cue_file|
options[:cue] = cue_file
oparrish / podcast.rb
Created Mar 31, 2012
Create podcast from directory
View podcast.rb
require 'rss/maker'
require 'optparse'
require 'uri'
opts = do |opts|
opts.on("-d", "--directory DIRECTORY", "Director of files") do |directory|
options[:directory] = directory
oparrish / audio_tag.rb
Created Mar 6, 2012
Jekyll tag plugin for creating HTML 5 audio element based on a list of source files
View audio_tag.rb
module Jekyll
class AudioTag < Liquid::Tag
def initialize(tag_name, files, tokens)
@files = files
def render(context)
HTML << '<audio controls="controls">'
oparrish / bootstrap_pagination_helper.rb
Created Sep 28, 2011
Link renderer to be used with will_paginate to render links to work with Twitter Bootstrap
View bootstrap_pagination_helper.rb
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
def page_number(page)
unless page == current_page
link(page, page, :rel => rel_value(page))
link(page, "#", :class => 'active')
oparrish / assets_deploy.rb
Created Sep 20, 2011
Rake task for copying Rails compiled assets to S3
View assets_deploy.rb
require 'aws/s3'
require 'digest/md5'
require 'mime/types'
## These are some constants to keep track of my S3 credentials and
## bucket name. Nothing fancy here.
oparrish /
Created Aug 25, 2011
Bash script for transcoding videos to AppleTV format to be used by an Alfred extension
#By Don Southard aka @binaryghost
#[UPDATE 6/01/2011 08:01:15PM]
#Idea and initialcode for Alfred progress bar by Andreas Heiberg
#Completly rewritten code by Don Southard
#[UPDATE 6/02/2011 08:58:09PM]
#Support for queueing, added information about queue status and ETA'S and the move the old file to trash feature
oparrish / gist:1134751
Created Aug 9, 2011
Move Message(s) to All Mail
View gist:1134751
tell application "Mail"
set theSelectedMessages to selection
set theMailbox to "[Gmail]/All Mail"
repeat with theMessage in theSelectedMessages
set messageAccount to account of mailbox of theMessage
tell application "Mail"
move the theMessage to mailbox theMailbox of messageAccount
end tell
end repeat
You can’t perform that action at this time.