Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Palm spudtrooper

View GitHub Profile
@spudtrooper
spudtrooper / keepdocs.py
Last active May 26, 2021
Produces markdown output of all Google Keep notes containing a certain phrase.
View keepdocs.py
"""
Produces markdown output of all Google Keep notes containing a certain phrase.
Requirements:
pip install gkeepapi
Usage:
python keepdocs.py <gmail-username> <gmail-password> <query>
Example:
@spudtrooper
spudtrooper / wikipedia-hover-menu.js
Created Apr 19, 2021
Makes wikipedia menus hover and track with the page, e.g. https://imgur.com/a/N6kMzrg
View wikipedia-hover-menu.js
/*
* Makes wikipedia menus hover and track with the page, e.g. https://imgur.com/a/N6kMzrg. To use, copy this link as a bookmark:
javascript:!function(){let s=$("#toc");s.css("position","fixed"),s.css("right","10px"),s.css("top","90px"),s.css("height","80%"),s.css("overflow","auto"),s.css("display","block")}();
*/
(function() {
let toc = $('#toc');
toc.css('position', 'fixed');
toc.css('right', '10px');
View like-all-tweets-on-a-page.js
(function() {
let divs = document.getElementsByTagName('div');
let count = 0;
for (var i = 0; i < divs.length; i++) {
let div = divs[i];
if (div.getAttribute('aria-label') &&
div.getAttribute('aria-label').match(/.*\. Like$/)) {
div.style.backgroundColor = '#00ff00';
div.click();
count++;
View kentucky_governors_race_nytimes.py
"""Print out nytimes kentucky governors results
e.g.
while [[ 1 ]]; do echo; echo ; date; python ./nytimes.py; sleep 5; done
"""
import urllib, json
View show_instagram_images.js
/*
* 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');
View out.diffg
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 Oct 4, 2016
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.
View amazonReviewTracker.js
// 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 Jan 10, 2015
Bookmarklet to view reddit with a sidebar and send the images to a chrome cast.
View redditcast.js
(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
View 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 Aug 29, 2015
Bookmarklet to favorite tweets on a page with a frequency of 5 seconds.
View twitter-favorite-loop.js
/*
* 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() {