This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Country</title> | |
<meta name="description" content=""> | |
<!-- Mobile-friendly viewport --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)),] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Data::Dumper; | |
use strict; | |
my $len; | |
my %tree; | |
while(<>) { | |
chomp; | |
if(/^[A-Za-z]+$/) { | |
$tree{length($_)}{$_} = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XMonad | |
import XMonad.Actions.CopyWindow | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Hooks.EwmhDesktops | |
--import XMonad.Hooks.ICCCMFocus | |
import XMonad.Hooks.SetWMName | |
import XMonad.Layout.NoBorders | |
import XMonad.Layout.Spiral | |
import XMonad.Util.Run(spawnPipe) |