Skip to content

Instantly share code, notes, and snippets.

View spudtrooper's full-sized avatar

Jeff Palm spudtrooper

View GitHub Profile
@spudtrooper
spudtrooper / ig_anon.js
Created July 31, 2023 11:31
Anonymously visit certain users' Instagram stories
// ==UserScript==
// @name Instagram story anonymous
// @namespace http://jeffpalm.com/
// @version 0.1
// @description Anonymously visit certain users' Instagram stories
// @author Jeff Palm
// @match https://www.instagram.com/*
// @grant none
// ==/UserScript==
@spudtrooper
spudtrooper / appscript_checkup.js
Last active July 18, 2023 13:00
Appscript to poll your email for a message indicating a check in. Read the comments.
/*
* Purpose:
* To check up on you, in case you have a pet or are travelling.
*
* How it works:
* - You will add a calendar invite every day or more than that
* with a link to send a email to yourself with a sentinel
* string (i.e. `TAG` below).
* - This script will periodically check your inbox for a message
*. with `TAG`, if it doesn't an email will go to a set of

Kudos to github copilot!

I wrote this:

// Verify that for each indiividual midi state, the states with notes on form a dense cluster.
for _, ms := range o.States {

And copilot suggested this:

<html>
<head>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<table id="tab" border=0></table>
<script>
const black = 'https://abs-0.twimg.com/emoji/v2/svg/2b1c.svg';
const yellow = 'https://abs-0.twimg.com/emoji/v2/svg/1f7e8.svg';
const green = 'https://abs-0.twimg.com/emoji/v2/svg/1f7e9.svg';
/*
Finds the total number of seconds in public tracks from your soundcloud.
Usage:
1. Navigate to https://soundcloud.com/you/tracks
2. Cycle through your tracks and run this on each page.
3. The total will print out on every run, e.g. 'total seconds 20657'
*/
(function () {
let soundBadges = document.getElementsByClassName('soundBadge');
@spudtrooper
spudtrooper / keepdocs.py
Last active May 26, 2021 10:21
Produces markdown output of all Google Keep notes containing a certain phrase.
"""
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 April 19, 2021 00:22
Makes wikipedia menus hover and track with the page, e.g. https://imgur.com/a/N6kMzrg
/*
* 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');
@spudtrooper
spudtrooper / like-all-tweets-on-a-page.js
Created January 20, 2021 15:57
Like all tweets on a page
(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++;
"""Print out nytimes kentucky governors results
e.g.
while [[ 1 ]]; do echo; echo ; date; python ./nytimes.py; sleep 5; done
"""
import urllib, json