This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>`; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i this_here.gif -vcodec h264 -y -pix_fmt yuv420p that_there.mov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess as sp | |
import numpy as np | |
import signal | |
from PIL import Image | |
### TUKEY WINDOW | |
# https://leohart.wordpress.com/2006/01/29/hello-world/ | |
def tukey_window(window_length, alpha=0.5): | |
# Special cases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import glob | |
import numpy as np | |
### TUKEY WINDOW | |
### https://leohart.wordpress.com/2006/01/29/hello-world/ | |
def tukey_window(window_length, alpha=0.5): | |
# Special cases | |
if alpha <= 0: |