Skip to content

Instantly share code, notes, and snippets.

Robin Sloan robinsloan

Block or report user

Report or block robinsloan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@robinsloan
robinsloan / sample.py
Created Dec 3, 2019
Just a sampling script
View sample.py
#!/usr/bin/env python3
import fire
import json
import os
import numpy as np
import tensorflow as tf
import re
from wordfilter import Wordfilter
import glob
@robinsloan
robinsloan / shh.rb
Last active Oct 14, 2019
Disable RTs from all the people you follow on Twitter.
View shh.rb
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
@robinsloan
robinsloan / delete-dms.js
Created Sep 1, 2019
Code for a bookmarklet to more quickly delete DMs via the Twitter web interface.
View delete-dms.js
// 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 / unfave.rb
Last active Jul 30, 2019
Unfave script, because why not??
View unfave.rb
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com
@robinsloan
robinsloan / langoliers.rb
Last active Jul 30, 2019
Tweet delete script
View langoliers.rb
require "rubygems"
require "twitter"
require "json"
# things you must configure
TWITTER_USER = "your_username"
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted
# get these from dev.twitter.com
CONSUMER_KEY = "your_consumer_key"
@robinsloan
robinsloan / archival-langoliers.rb
Last active Jun 30, 2019
Tweet delete script using your Twitter archive as an index
View archival-langoliers.rb
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
View unfollow.rb
require "rubygems"
require "twitter"
# get these from apps.twitter.com
CONSUMER_KEY = "abcd"
CONSUMER_SECRET = "abcd"
OAUTH_TOKEN = "abcd"
OAUTH_TOKEN_SECRET = "abcd"
TWITTER_USER = "your_username" # needs to be the one associated with keys above
View wiggletech.html
<html>
<head>
<style type="text/css">
body {
font-family: Arial, sans-serif;
font-size: 64px;
}
View ruby_zip.rb
# zip two collections together then iterate in lockstep
first_names = "Clark", "Bruce", "Diana"
last_names = "Kent", "Wayne", "Troy"
first_names.zip(last_names) do |first, last|
puts "#{first} #{last}"
end
@robinsloan
robinsloan / gif-to-vid.sh
Created Aug 28, 2017
FFMPEG command to convert GIF to proper MP4
View gif-to-vid.sh
ffmpeg -i this_here.gif -vcodec h264 -y -pix_fmt yuv420p that_there.mov
You can’t perform that action at this time.