Skip to content

Instantly share code, notes, and snippets.

View robinsloan's full-sized avatar

Robin Sloan robinsloan

View GitHub Profile
@robinsloan
robinsloan / template.html
Last active December 28, 2022 03:17
Just a super simple HTML email template
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta content="width=device-width" name="viewport" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="generator" content="The very hands of Sloan"/>
<base href="https://fat.gold/" />
<style type="text/css">
@robinsloan
robinsloan / sync-list.rb
Created July 20, 2021 02:50
This script will sync your current followings to one of your lists. It will add users to the list who you are following, and remove users from the list who you are not following.
require "rubygems"
require "twitter"
require "date"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
@robinsloan
robinsloan / pushing-fragments.js
Created April 13, 2020 02:55
Just a little snippet for Tom
F.visibleTextFragments.push(newFragment);
let text = `<p>`;
if (F.visibleTextFragments.length > 0) {
let visibleText = F.visibleTextFragments.reduce(function(visibleFragments, thisFragment) {
return visibleFragments + thisFragment;
});
text += `<span class="visible">${visibleText}</span>`;
}
-- note: 256 numbers in table
local notes = { 4.8, 4.0, 4.1, 4.4, 4.8, 5.0, 5.1, 5.4, 5.8, 6.0, 6.1, 6.4, 6.8, 7.0, 7.1, 7.4, 7.8, 7.4, 7.1, 7.0, 6.8, 6.4, 6.1, 6.0, 5.8, 5.4, 5.1, 5.0, 4.8, 4.4, 4.1, 4.0, 4.5, 4.7, 4.8, 4.1, 4.5, 4.7, 4.8, 5.1, 5.5, 5.7, 5.8, 6.1, 6.5, 6.7, 6.8, 7.1, 7.5, 7.1, 6.8, 6.7, 6.5, 6.1, 5.8, 5.7, 5.5, 5.1, 4.8, 4.7, 4.5, 4.1, 4.8, 4.7, 4.8, 4.0, 4.1, 4.4, 4.8, 5.0, 5.1, 5.4, 5.8, 6.0, 6.1, 6.4, 6.8, 7.0, 7.1, 7.4, 7.8, 7.4, 7.1, 7.0, 6.8, 6.4, 6.1, 6.0, 5.8, 5.4, 5.1, 5.0, 4.8, 4.4, 4.1, 4.0, 4.5, 4.7, 4.8, 4.1, 4.5, 4.7, 4.8, 5.1, 5.5, 5.7, 5.8, 6.1, 6.5, 6.7, 6.8, 7.1, 7.5, 7.1, 6.8, 6.7, 6.5, 6.1, 5.8, 5.7, 5.5, 5.1, 4.8, 4.7, 4.5, 4.1, 4.8, 4.7, 4.5, 4.8, 4.2, 4.4, 4.5, 4.8, 5.2, 5.4, 5.5, 5.8, 6.2, 6.4, 6.5, 6.8, 7.2, 7.4, 7.5, 7.4, 7.2, 6.8, 6.5, 6.4, 6.2, 5.8, 5.5, 5.4, 5.2, 4.8, 4.5, 4.4, 4.2, 4.8, 4.7, 4.0, 4.4, 4.5, 4.7, 5.0, 5.4, 5.5, 5.7, 6.0, 6.4, 6.5, 6.7, 7.0, 7.4, 7.5, 7.7, 7.5, 7.4, 7.0, 6.7, 6.5, 6.4, 6.0, 5.7, 5.5, 5.4, 5.0, 4.7, 4.5, 4.4, 4.0, 4.5, 4.8, 4.0, 4.4
@robinsloan
robinsloan / delete-dms.js
Created September 1, 2019 00:32
Code for a bookmarklet to more quickly delete DMs via the Twitter web interface.
// This doesn't work THAT well, but it kinda works... so!
// 1. Make a new bookmarklet with the code below as its URL
// 2. Go to mobile.twitter.com/messages
// 2a. This won't work on the "normal" DM pages, i.e., not the mobile site
// 3. Select a thread
// 3a. So, you see a list of messages now, right?
// 4. Click this bookmarklet :)
// 5. repeat as many times as necessary!
// 6. I think this probably goes without saying, but this doesn't delete your DMs from the *other* person's account. But it does make them invisible to, e.g., someone who hacks your account. Not that that's ever going to happen.
// 6a. It's definitely going to happen
@robinsloan
robinsloan / wiggletech.html
Last active October 12, 2021 07:31
WiggleTech
<html>
<head>
<style type="text/css">
body {
font-family: Arial, sans-serif;
font-size: 64px;
}
@robinsloan
robinsloan / autoresponder.txt
Created November 30, 2018 19:21
Twitter DM autoresponder
# First,
twurl authorize --consumer-key YOUR_CONSUMER_KEY --consumer-secret YOUR_CONSUMER_SECRET
# Then,
twurl -A 'Content-type: application/json' -X POST /1.1/direct_messages/welcome_messages/new.json -d '{"welcome_message": {"name": "autoresponder", "message_data": {"text": "Hi! I am not currently checking DMs. You can email me instead 👉 YOUR EMAIL HERE"}}}'
# In the response, note the id of the returned welcome message object, because you'll need it in a moment.
@robinsloan
robinsloan / bad-fax-filter.svg
Created September 12, 2018 17:08
I like the look of this
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robinsloan
robinsloan / archival-langoliers.rb
Last active February 8, 2023 11:15
Tweet delete script using your Twitter archive as an index
require "rubygems"
require "twitter"
require "json"
require "csv"
#require "date"
# things you must configure
TWITTER_USER = "your_twitter_username"
MAX_AGE_IN_DAYS = 7 # anything older than this is deleted
@robinsloan
robinsloan / shh.rb
Last active August 18, 2023 12:09
Disable RTs from all the people you follow on Twitter.
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "foo"
CONSUMER_SECRET = "bar"
OAUTH_TOKEN = "blee"
OAUTH_TOKEN_SECRET = "baz"
TWITTER_USER = "your_username" # needs to be the one associated with keys above