Skip to content

Instantly share code, notes, and snippets.

@andrewgilmartin
andrewgilmartin / gist:26fd5b2ce02a3219c96c
Last active August 29, 2015 14:08
Bookmarklet to cleanup Kindle Your Highlights page
javascript:(function(){
var O = $('<div class="books"/>');
var S;
var xs = $("#allHighlightedBooks").children();
for ( var i = 0; i < xs.length; i++ ) {
var x = $(xs[i]);
var c = x.attr("class");
if ( c.indexOf("bookMain") != -1 ) {
t = $('.title',x).text();
a = $('.author',x).text();

#The Uses of Poverty: The Poor Pay All.

Herbert J. Gans.

Social Policy July/August 1971: pp. 20-24.

Some twenty years ago Robert K. Merton applied the notion of functional analysis to explain the continuing though maligned existence of the urban political machine: if it continued to exist, perhaps it fulfilled latent - unintended or unrecognized - positive functions. Clearly it did. Merton pointed out how the political machine provided central authority to get things done when a decentralized local government could not act, humanized the services of the impersonal bureaucracy for fearful citizens, offered concrete help (rather than abstract law or justice) to the poor, and otherwise performed services needed or demanded by many people but considered unconventional or even illegal by formal public agencies.

Today, poverty is more maligned than the political machine ever was; yet it, too, is a persistent social phenomenon. Consequently, there may be some merit in applying functional analysis to poverty, i

#!/usr/bin/perl -w
use strict;
my $length_proportion = 5;
my $width_proportion = 2;
my $height_proportion = 1;
for my $volume ( ( 500, 120, 100, 85, 75, 60, 50, 40, 25, 10 ) ) {
my $n = ( $volume / $length_proportion / $width_proportion / $height_proportion ) ** (1/3);
<project name="pdf-thumbnailer" default="jar">
<property name="compile.debug" value="true" />
<property name="compile.deprecation" value="false" />
<property name="compile.optimize" value="false" />
<path id="compile.classpath">
<fileset dir="${basedir}/lib">
<include name="*.jar" />
package pdfthumbnailer;
import com.sun.pdfview.PDFFile;
import com.sun.pdfview.PDFPage;
import java.awt.Image;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.File;
// See http://remorse.nl/weblog/get_the_mousecursor_position_relative_to_an_element_with_prototype/
function relativeEventLocation(event,container){
if ( container == null ) {
container = Event.element(event);
}
//get the position of the container
var containerLeft = Position.page(container)[0];
var containerTop = Position.page(container)[1];
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<!-- See http://blog.themeforest.net/tutorials/the-web-designers-guide-to-blogger-templates/ -->
<head>
<title><data:blog.pageTitle/></title>
<link href='http://com.andrewgilmartin.blogger.s3.amazonaws.com/blueprint_grid_150_20_18.css' rel='stylesheet' type='text/css'/>
<b:include data='blog' name='all-head-content'/>
<b:skin><![CDATA[
BODY { padding: 0; margin: 0; }
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html" />
<title>jQuery Column Tree Table</title>
<link rel="stylesheet" href="http://jqueryui.com/themeroller/css/parseTheme.css.php?ffDefault=Lucida+Grande,+Lucida+Sans,+Arial,+sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColo
( function( substitution_cipher_grid ) {
var substitution_cipher={};
var rows = substitution_cipher_grid.split(".");
for ( var r = 0; r < rows.length; r++ ) {
var cells = rows[r].strip().split( /\s+/ );
for ( var c = 0; c < cells.length; c++ ) {
substitution_cipher[cells[c]]=c+1
}
}
var domain = window.location.host.split('.').reverse().splice(0,2).reverse().join('.');
#!/bin/bash
function split() {
file="$1"
dir="$2"
odd="$3"
even="$4"
pages=$(/usr/local/bin/pdfinfo "$file" | perl -ne 'print "$1" if /^Pages:\s+(\d+)/')
/usr/local/bin/pdfseparate "$file" "$dir/p-%d.pdf"