Skip to content

Instantly share code, notes, and snippets.

View cincodenada's full-sized avatar

Ell Bradshaw cincodenada

View GitHub Profile
@cincodenada
cincodenada / OrderedFriendsList.js
Created December 3, 2012 22:21
A snippet of Facebook's javascript, decompressed a bit
bigPipe.onPageletArrive({
"is_last": true,
"content": {
"pagelet_sidebar": {
"container_id": "u5da1gw108"
}
},
"jsmods": {
"instances": [
["m229365_110", ["ScrollableArea", "m229365_109"],
@cincodenada
cincodenada / emergent_auth.php
Created November 9, 2012 23:29
Emergent API Authentication Client
<?php
ini_set('display_errors','on');
error_reporting(E_ALL);
//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();
var fileref=document.createElement('script'); fileref.setAttribute("type","text/javascript");fileref.setAttribute("src", 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js'); 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
cincodenada / facebook_cscript.js
Created May 23, 2012 19:45
Modified script for the "Add Facebook Events to Google Calendar" Chrome extension
postpone();
function postpone()
{
init();
window.setTimeout(postpone,500);
}
function init()
{
@cincodenada
cincodenada / splitwav.py
Created March 25, 2012 06:10
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 = wave.open(argv[1],"r")
one = wave.open("split_one.wav","w")
two = wave.open("split_two.wav","w")
data = sound.readframes(sound.getnframes())
one.setparams(sound.getparams())
@cincodenada
cincodenada / 3dify.sh
Created September 29, 2015 05:29
Script that takes a gif and attempts to make a crossview 3D gif by duplicating sbs and delaying the right half by two frames.
#!/bin/bash
FRAME="frame.gif"
INFILE=$1
OUTFILE=$2
MOVEBY=2
NUMFRAMES=`gifsicle -I $INFILE |
perl -ne 'if(/(\d+) images/) { print $1;}'`
echo "Cleaning up any previous runs..."
rm -rf left
rm -rf right
@cincodenada
cincodenada / fullcalendar.js
Created December 15, 2011 01:54
FullCalendar modifications
/**
* @preserve
* FullCalendar v1.5.1
* http://arshaw.com/fullcalendar/
*
* 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
<?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
cincodenada / xkcdpull.pl
Created March 19, 2011 05:50
A basic script to pull down xkcd comics and create a TSV index of them.
#!/usr/local/bin/perl
#use strict;
#use warnings;
use LWP::Simple;
my $baseurl = 'http://www.xkcd.com/';
my $comicnum = 1;
open (TSV, '>>index.csv');
while($pagecontent = get("$baseurl$comicnum/")) {
$comicnum++;
@cincodenada
cincodenada / xkcdeffect.pl
Created March 19, 2011 05:59
This is the script I used when writing my blog post about the XKCD effect (http://commacommacrash.com/2009/12/what-i-learned-from-xkcd-effect.html). A base for all my WWW::Mechanize scripts.
#!/usr/bin/perl
use LWP::Simple;
use WWW::Mechanize;
use HTTP::Cookies;
use Term::ReadKey;
use POSIX qw(strftime mktime);
my $interneturl = "http://www.google.com";
my $internet = "Google";