Skip to content

Instantly share code, notes, and snippets.

@freejoe76
freejoe76 / __init__.py
Last active August 29, 2015 14:04
Delete The Last Comma
#!/usr/bin/env python
@freejoe76
freejoe76 / FtpWrapper.py
Last active August 29, 2015 14:05
ftpWrapper.py
#!/usr/bin/env python
# FTP files with python.
from ftplib import FTP
import os
from optparse import OptionParser
class FtpWrapper():
""" class ftpWrapper handles FTP operations. Assumes the password is stored
in a file named '.ftppass' in the class directory.
Currently this works best for uploading one or two files. Needs to be
@freejoe76
freejoe76 / iframe_breaker.js
Created October 13, 2014 20:25
iframe_breaker.js
if (top !== self)
{
// We want to track when this happens, which we do with a custom
// ?source=framebuster query added to the URL.
// The challenge is, often there's already a ?source=rss on the URL,
// which means we have to handle that too.
var sourcedomain = 'denverpost.com';
var sourceurl = self.document.location.toString();
var referrer = document.referrer.split('/')[2];
if ( sourceurl.indexOf("www." + sourcedomain) > 0 && referrer.indexOf(sourcedomain) < 0 )
@freejoe76
freejoe76 / parse_csv.py
Created November 25, 2014 16:52
Parse a CSV into another file
#!/usr/bin/env python
import csv
def main():
""" Take a CSV, write it to a file. """
with open('name-of-file.csv', 'rb') as csvfile:
i = 0
content = []
reader = csv.reader(csvfile)
for row in reader:
@freejoe76
freejoe76 / everyword.txt
Last active August 29, 2015 14:14
Every Word
a
aardvark
aardwolf
ab
aba
abaca
abacist
aback
abactinal
abacus
@freejoe76
freejoe76 / hit-and-runs.csv
Last active August 29, 2015 14:15
Hit and runs and vehicular homicides in Denver, 2010-2015 via Denver Police Department
We can't make this file beautiful and searchable because it's too large.
id, category, type, date_reported, address, neighborhood, lat, lon
201593096540100, traffic-accident, traffic-accident-hit-and-run, 2015-02-17 00:15:59, 4800 BLOCK W GILL PL, westwood, 39.7048142, -105.0487949
201592793540100, traffic-accident, traffic-accident-hit-and-run, 2015-02-16 19:44:00, S ONEIDA ST / E TENNESSEE AVE, washington-virginia-vale, 39.698434, -104.9082345
201592662540100, traffic-accident, traffic-accident-hit-and-run, 2015-02-16 18:56:00, 5200 BLOCK N QUEBEC ST, stapleton, 39.7891756, -104.9031733
201592778540100, traffic-accident, traffic-accident-hit-and-run, 2015-02-16 19:28:59, 4060 S TAMARAC DR, hampden-south, 39.6418407, -104.8930407
201592562540100, traffic-accident, traffic-accident-hit-and-run, 2015-02-16 17:03:59, I25 HWYNB / E HAMPDEN AVE, hampden-south, 39.6530788, -104.9182593
201592493540100, traffic-accident, traffic-accident-hit-and-run, 2015-02-16 16:53:00, 3200 BLOCK N PECOS ST, highland, 39.762146, -105.0063315
201592368540100, traffic-accident, traffic-accident-hit-and-
@freejoe76
freejoe76 / frontier online checkin.md
Last active August 29, 2015 14:19
QA'ing Frontier Airlines' check-in process

It took me three tries to check in on Frontier Airlines.

Here's what happened:

  1. First I clicked the "Check In Here" link in my "it's time to check in for your flight" email from Frontier: https://rebooking.flyfrontier.com/LinkTracking?id=727475&url=https://booking.flyfrontier.com/checkin/inline?rl=OTJZVA&ln=MURPHY&utm_campaign=transactional&utm_source=checkin&utm_source=checkin
  2. That took me to a page with an error message on it, "Unable to checkin at this time, please try again later." Seeing as I don't really trust Frontier's site anyway, I disregarded that error message and clicked to Frontier's homepage, then to its My Trip / Check-in tab. I entered my reservation code and name and clicked the "Search" button.
  3. That took me to a full-page ad for a Barclay's / Frontier credit card. I spent a minute scrolling up and down the page for a no-thanks / continue-type link, there were none, just a link to sign up for a credit card I already have (and Frontier knows I already have, it's saved in my Frontier
@freejoe76
freejoe76 / ums_2015.csv
Last active August 29, 2015 14:25
Bands I want to see at UMS 2015
artist day time venue url
Leggy Thursday 8 p.m. Hi-Dive https://leggy.bandcamp.com/
Baby Birds Don't Drink Milk Thursday 10 p.m. Hi-Dive https://soundcloud.com/bbddm
Ambit Thursday 11 p.m. Blue Ice Lounge https://soundcloud.com/greetingsfromambit
Bear Antler Thursday 11 p.m. Illegal Pete's http://www.bearantler.com/
LSD Bags Friday 9 p.m. Irish Rover http://lsdbags.bandcamp.com/
Cop Circles Saturday 10 p.m. Brendan's Pub http://copcircles.bandcamp.com/
Panther Martin Sunday 5 p.m. Irish Rover https://soundcloud.com/panther-martin
Turner Jackson Sunday 10 p.m. Blue Ice Lounge https://soundcloud.com/turnerjacksonmusic
High Five Sunday 11 p.m. Blue Ice Lounge https://soundcloud.com/highfivehiphop
@freejoe76
freejoe76 / tweetcheck.sh
Last active September 30, 2015 03:38
Email one or many people when a twitter account hasn't been updated in the last hour.
#!/bin/sh
#
# NOTE: Twitter updated their m.twitter site January 2013, and this script doesn't work anymore.
#
# This script is useful for alerting a team of people when a twitter account
# hasn't been updated in the past hour. There may be other uses as well.
#
# $1 = what account to check
# $2 = what string to look for. To test the script, use 'test'
#
@freejoe76
freejoe76 / django1.4
Created March 23, 2012 17:39
Full tracklist for my yet-to-be-released second album, Backwards-incompatible changes
# Inspired by the release notes for Django 1.4, https://docs.djangoproject.com/en/dev/releases/1.4/
#
# Note: None of these tracks are actually backwards-incompatible with anything.
# They're song names not software, duh.
BACKWARDS-INCOMPATIBLE CHANGES
1. WSGI WSGI WSKE
2. Difficult-to-debug path issues
3. Double imports
4. Same code