Skip to content

Instantly share code, notes, and snippets.

View spudtrooper's full-sized avatar

Jeff Palm spudtrooper

View GitHub Profile
/*
* 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 / 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 / redditcast.js
Created January 10, 2015 19:07
Bookmarklet to view reddit with a sidebar and send the images to a chrome cast.
(function() {
/*
* Bookmarklet to view reddit with a sidebar and send the images to a chrome
* cast. To use:
*
* 1. Go to http://reddit.com/r/pics
* 2. Start casting
* 3. Click the link in http://jsfiddle.net/erkdp48b/
*
* When you click links on the left, the images will be sent to your
@spudtrooper
spudtrooper / tmux.cheat
Last active August 29, 2015 14:06 — forked from afair/tmux.cheat
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@spudtrooper
spudtrooper / twitter-favorite-loop.js
Last active August 29, 2015 14:03
Bookmarklet to favorite tweets on a page with a frequency of 5 seconds.
/*
* Bookmarklet to favorite tweets on a page with a frequency of 5 seconds.
*
* Usage
* =====
* Copy the link "Favorite tweets" from http://jsfiddle.net/bfCnZ/1/ to your
* toolbar and this will favorite items at a frequency of 5 seconds.
*/
(function() {
@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++) {
@spudtrooper
spudtrooper / twittercowsay
Created February 21, 2014 13:04
Prints a user's twitter stream using cowsay.
#!/bin/sh
#
# Prints a user's twitter stream using cowsay.
#
# Usage:
#
# % twittercowsay <user>
#
# http://jeffpalm.com/twitterer
#
@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
@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>