Skip to content

Instantly share code, notes, and snippets.

View spudtrooper's full-sized avatar

Jeff Palm spudtrooper

View GitHub Profile
@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/*
"""Print out nytimes kentucky governors results
e.g.
while [[ 1 ]]; do echo; echo ; date; python ./nytimes.py; sleep 5; done
"""
import urllib, json
/*
* Shows the various sized images for an instagram image.
*
* Usage:
* 1. Click on an instagram thumbnail.
* 2. Run this.
*/
(function() {
let srcset = document.querySelector('img[sizes="600px"]')
.getAttribute('srcset');
commit 6c29a9b1835c820ab0abfd5e8c9c86d399d272b5
Author: Jeff Palm <jeffpalm@gmail.com>
Date: Sun Jan 27 14:18:03 2019 -0500
Add failure callback on decoding failure
diff --git a/ios/RNReactNativeSharingWinstagram.m b/ios/RNReactNativeSharingWinstagram.m
index 1607079..03814de 100644
--- a/ios/RNReactNativeSharingWinstagram.m
+++ b/ios/RNReactNativeSharingWinstagram.m
@spudtrooper
spudtrooper / smugmug.js
Created June 8, 2014 21:20
Shows the full-size image URLs for a page of thumbnails on smugmug.com
/*
* This will find the full-size image urls of a smugmug.com page.
*/
const MINIMUM_IMAGE_WIDTH = 1000;
/** Gets the url of the link to close a full-size image lightbox. */
function getCloseLink() {
var els = document.getElementsByTagName('a');
for (var i = 0; i < els.length; i++) {
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 / index.html
Created July 21, 2013 11:58
Simple PHP script to show the number of current viewers of a web page.
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript" src="webcounter.php"></script> current viewers.
</body>
</html>
@spudtrooper
spudtrooper / amazonReviewTracker.js
Last active October 4, 2016 19:27
Shows updated number of reviews from amazon in a big ugly div and in the page title. Go to a book page (e.g. https://www.amazon.com/100-Tricks-Appear-Smart-Meetings/dp/1449476058/) and paste this into the JS console.
// Update every 3 seconds, may want to change this.
var updatePeriodMillis = 1000;
var lastRevs = 0;
var d = document.createElement('div');
d.innerHTML =
'<div style="position: absolute; left: 150px; top: 250px; background-color: rgb(119,0,0); width: 1200px; height: '
+ '800px; color: #fff; font-family: arial; right: 150px; padding: 20px;" id="reviews">'
+ ' <div id="numReviews" style="position: relative; font-size:6em; left: 10px; top: 10px;">--</div>'
+ ' <div style="margin-top:20px; position: relative; font-size:1em; left: 10px; top: 10px;">Last updated</div>'
+ ' <div id="lastUpdated" style="margin-top:10px; position: relative;font-size:2em; left: 10px;top: 10px;">not updated</div>'
@spudtrooper
spudtrooper / jar2java
Created October 31, 2011 13:45
Generates java source from a jar file (e.g. for use in javadoc)
#!/bin/sh
#
# Transforms a jar file into source and outputs source files to 'src'.
# Example:
#
# jar2java foo.jar ; --> source to 'src'
#
# After you can run javadoc on these files, e.g.
#
# javadoc -classpath foo.jar -d api `find src -name "*.java"`
@spudtrooper
spudtrooper / ccho.sh
Created July 27, 2013 23:34
Echos the message in a color given by the first argument.
# Echos the message in a color given by the first argument.
#
# Example:
#
# % ccho red "This is red"
#
# Outputs "This is red" in red
#
# The following colors are supported
# red|r - RED