Skip to content

Instantly share code, notes, and snippets.


Joel Bradshaw cincodenada

View GitHub Profile
cincodenada /
Created Feb 5, 2011
My basic hack to pull down all of my track history from Last.FM into XML and CSV. It even has resume/top-off functionality.
#Taken from
import csv, codecs, cStringIO
class UTF8Recoder:
Iterator that reads an encoded stream and reencodes the input to UTF-8
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
cincodenada /
Created Mar 19, 2011
A basic script to pull down xkcd comics and create a TSV index of them.
#use strict;
#use warnings;
use LWP::Simple;
my $baseurl = '';
my $comicnum = 1;
open (TSV, '>>index.csv');
while($pagecontent = get("$baseurl$comicnum/")) {
cincodenada /
Created Mar 19, 2011
This is the script I used when writing my blog post about the XKCD effect ( A base for all my WWW::Mechanize scripts.
use LWP::Simple;
use WWW::Mechanize;
use HTTP::Cookies;
use Term::ReadKey;
use POSIX qw(strftime mktime);
my $interneturl = "";
my $internet = "Google";
View http_build_url.php
if (!function_exists('http_build_url'))
define('HTTP_URL_REPLACE', 1); // Replace every part of the first URL when there's one of the second URL
define('HTTP_URL_JOIN_PATH', 2); // Join relative paths
define('HTTP_URL_JOIN_QUERY', 4); // Join query strings
define('HTTP_URL_STRIP_USER', 8); // Strip any user authentication information
define('HTTP_URL_STRIP_PASS', 16); // Strip any password authentication information
define('HTTP_URL_STRIP_AUTH', 32); // Strip any authentication information
define('HTTP_URL_STRIP_PORT', 64); // Strip explicit port numbers
cincodenada / fullcalendar.js
Created Dec 15, 2011
FullCalendar modifications
View fullcalendar.js
* @preserve
* FullCalendar v1.5.1
* Use fullcalendar.css for basic styling.
* For event drag & drop, requires jQuery UI draggable.
* For event resizing, requires jQuery UI resizable.
* Copyright (c) 2011 Adam Shaw
cincodenada /
Created Mar 25, 2012
A quick script to split a sample-interlaced wav into two files, used for testing my Honors Project.
from sys import argv
import wave
sound =[1],"r")
one ="split_one.wav","w")
two ="split_two.wav","w")
data = sound.readframes(sound.getnframes())
cincodenada / facebook_cscript.js
Created May 23, 2012
Modified script for the "Add Facebook Events to Google Calendar" Chrome extension
View facebook_cscript.js
function postpone()
function init()
View gist:3701961
var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript");fileref.setAttribute("src", ''); document.getElementsByTagName("head")[0].appendChild(fileref);
$('div[href^="/files"]').each(function(idx, el) { href = $(el).attr('href'); $(el).replaceWith('<a href="' + href + '">Download</a>') });
cincodenada / emergent_auth.php
Created Nov 9, 2012
Emergent API Authentication Client
View emergent_auth.php
//This is less than desirable, but we'll figure out restructuring later
$backend_path = '../../../backend/';
require_once($backend_path . 'lib/logger.php');
require_once($backend_path . 'config.php');
$logger = new Logger();
cincodenada / OrderedFriendsList.js
Created Dec 3, 2012
A snippet of Facebook's javascript, decompressed a bit
View OrderedFriendsList.js
"is_last": true,
"content": {
"pagelet_sidebar": {
"container_id": "u5da1gw108"
"jsmods": {
"instances": [
["m229365_110", ["ScrollableArea", "m229365_109"],