Skip to content

Instantly share code, notes, and snippets.

View cincodenada's full-sized avatar

Ell Bradshaw cincodenada

View GitHub Profile
@cincodenada
cincodenada / README.md
Last active April 1, 2016 23:55
Robin Counter

Copy/paste the following into the target for a bookmark:

javascript:void%20function(){function%20o(s){n.forEach(function(o){var%20n=$(%22.robin-room-participant.robin--vote-class--%22+o).length;$(%22.robinmod-users-%22+o).text(n),console.log(%22Updated%20%22+o+%22%20count:%20%22+n)});var%20a=$(%22.robin-room-participant%22).length;$(%22.robinmod-users-total%22).text(a),console.log(%22Updated%20total%20count:%20%22+a),setTimeout(o,s)}$ourdiv=$(%22%23robinmod-counts%22);var%20n=[%22increase%22,%22continue%22,%22abandon%22,%22novote%22];$ourdiv.length||($ourdiv=$('%3Cdiv%20id=%22robinmod-counts%22%20style=%22margin:%205px%2015px%22%3EUsers%20here:%20%3Cspan%20class=%22robinmod-users-total%22%3E%3C/span%3E%20(%3Cspan%20class=%22robinmod-subcounts%22%3E%3C/span%3E)%20%3C/div%3E'),n.forEach(function(o){$ourdiv.find(%22.robinmod-subcounts%22).append('%3Cspan%20class=%22robin--vote-class--'+o+'%22%3E%3Cspan%20class=%22robin--icon%22%3E%3C/span%3E%3Cspan%20class=%22robinmod-users-'+o+'%22%3E%3C/span%3E%3C/span%3E

@cincodenada
cincodenada / tableizer.js
Last active March 13, 2016 19:32
Pulls arbitrary table data out into a TSV
trs = document.querySelectorAll('tr');
Array.prototype.map.call(trs, function(tr) {
if(tr.children.length > 2) {
return Array.prototype.map.call(tr.children, function(td) {
return td.textContent.trim();
}).join("\t");
} else {
return null;
}
}).join("\n");
@cincodenada
cincodenada / delayspec.pl
Created February 11, 2016 04:19
Gifsicle Speed Changer
use POSIX;
if($#ARGV == -1) { die "No speedup value specified!"; }
$speedup = shift(@ARGV);
while(<>) {
if(/\+ image #(\d+)/) {
$num = $1;
} elsif(/delay ([\d\.]+)s/) {
$delay = POSIX::strtod($1);
$delay /= $speedup;
if($lastdelay && $lastdelay != $delay) {
@cincodenada
cincodenada / save_body.py
Last active February 27, 2016 15:32 — forked from mhils/save_body.py
Update for new API
from libmproxy.model import decoded
def response(context, flow):
with decoded(flow.response): # automatically decode gzipped responses.
with open("body.txt","ab") as f:
f.write(flow.response.content)
@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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Country</title>
<meta name="description" content="">
<!-- Mobile-friendly viewport -->
@cincodenada
cincodenada / data.tsv
Created August 21, 2014 05:13
Music Purchase graph re-creatgion from /r/dataisbeautiful
8-Track 1980 14.3
8-Track 1981 7.9
8-Track 1982 1.0
8-Track 1983 0.0
8-Track 1984 0.0
8-Track 1985 0.0
8-Track 1986 0.0
8-Track 1987 0.0
8-Track 1988 0.0
8-Track 1989 0.0
@cincodenada
cincodenada / hotelstuff.R
Last active August 29, 2015 14:04
Hotel Graph from /r/dataisugly
library(ggplot2)
library(scales)
library(grid)
nicer_still = T
hotelstuff = read.csv('hotelstuff.tsv',sep="\t")
if(nicer_still) {
#Order by revenue change
hotelstuff = hotelstuff[with(hotelstuff,order(-Revenue.Change)),]
@cincodenada
cincodenada / startling.pl
Last active August 29, 2015 13:57
Word deconstruction finder
#!/usr/bin/perl
use Data::Dumper;
use strict;
my $len;
my %tree;
while(<>) {
chomp;
if(/^[A-Za-z]+$/) {
$tree{length($_)}{$_} = [];
(function(){
GEvent.clearListeners(gmap, "click");
document.getElementsByTagName('input')[0].insertAdjacentHTML('afterend','Drive Times: <input id="minutes" style="width:5em" type="text" value="5 15"/> (in minutes, separate multiple times with spaces)');
GEvent.addListener(gmap, "click", function(marker, point) {
if(!marker){
mapExtension.removeFromMap(gOverlays);
var frslayer = new esri.arcgis.gmaps.FeatureSet();
var feature = new esri.arcgis.gmaps.Feature();
feature.geometry = point;