Skip to content

Instantly share code, notes, and snippets.

View spudtrooper's full-sized avatar

Jeff Palm spudtrooper

View GitHub Profile
@spudtrooper
spudtrooper / display-more.js
Last active December 13, 2015 21:08
Bookmarklet to expand the search results from: - nakedapartments.com - craigslist.org More: http://www.jeffpalm.com/blog/archives/002259.html
/**
* Bookmarklet to expand the search results from:
* - nakedapartments.com
* - craigslist.org
* More: http://www.jeffpalm.com/blog/archives/002259.html
*/
(function() {
const REPLACE_TOKEN = '${replace.token}';
@spudtrooper
spudtrooper / nakedapartments-bookmarklet.js
Created February 16, 2013 21:12
Bookmarklet to show all the listings from nakedaparments.com on a single page.
/**
* Displays all the results from nakedapartments.com.
*/
(function() {
const REPLACE_TOKEN = '${replace.token}';
const RESULTS_CLASS_NAME = 'listing-results floatLeft';
const LISTING_CLASS_NAME = 'listing-row listing-row-standard clearfix';
/**
@spudtrooper
spudtrooper / inbetween
Created December 25, 2012 15:04
Prints out every in between the first two arguments
#!/bin/sh
#
# Prints out every in between the first two arguments:
#
# Example:
#
# % inbetween '- - \[' '\]' # Dates from an apache log file
#
fst=$1; shift
if [[ x$fst = 'x' ]]; then
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import java.util.List;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.net.*;
/**
@spudtrooper
spudtrooper / selectAllGmail.js
Created November 23, 2012 16:46
Bookmarklet to selects all of the last opened gmail message.
/*
* Selects all of the last opened gmail message.
*/
(function() {
function setSelection(el) {
var range = document.createRange();
var fst = el.firstChild, lst = el.lastChild;
if (fst && lst) {
range.setStartBefore(fst);
@spudtrooper
spudtrooper / Makefile
Created October 24, 2012 04:55
American Voices
all: americanVoices.html
gather:
python americanVoices.py >> results.txt
americanVoices.html: results.txt
sort $< | uniq | python genHtml.py > $@
@spudtrooper
spudtrooper / ImageToXls.java
Created September 11, 2012 04:51
Convert a JPEG image to Excel spreadsheet (e.g. http://bit.ly/QBd4HI)
import java.awt.*;
import java.awt.Image;
import java.awt.image.*;
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.List;
import javax.imageio.*;
import javax.swing.*;
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import java.util.List;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.net.*;
public final class LesPaulImage {
@spudtrooper
spudtrooper / monitor.sh
Created March 17, 2012 16:55
Monitors the file you pass in, printing the number of lines. You pass in the optional file as the first parameter (defaults to most recently updated file) and optional sleep time in seconds as the second argument.
#!/bin/sh
#
# Monitors the file you pass in, printing the number of lines. You
# pass in the optional file as the first parameter (defaults to most
# recently updated file) and optional sleep time in seconds as the
# second argument.
#
# Examples:
#
# % ./monitor # -- use the most recently updated file
@spudtrooper
spudtrooper / twitterBatch.user.js
Created March 13, 2012 12:53
Only display twitter updates in batches of certain numbers. By default the minimum number of item required to show is 10, this can be changed via localStorage to, say, N, e.g. localStorage.setItem('batch.number',N)
// ==UserScript==
// @name Twitter Batch
// @namespace http://jeffpalm.com/twitterbatch
// @description Only display twitter updates in batches of certain numbers.
// By default the minimum number of item required to show is
// 10, this can be changed via localStorage to, say, N, e.g.
// localStorage.setItem('batch.number',N)
// @include https://twitter.com
// @include https://www.twitter.com
// @include https://twitter.com/*