I often find myself wanting to grab the contents of a tweet in Markdown format to post on my blog, so I’ve created an iOS shortcut that takes the URL to a tweet, grabs the contents via the public Twitter API, expands t.co URLs, and copies the content to the clipboard.
Here’s an example tweet:
It’s surprisingly hard to find a tweet with multiple URLs in it for API response testing purposes.— Max Masnick (@masnick) December 25, 2019
So here are my two favorite non-Google search engines:
And here’s what the output of the Shortcut looks like:
I have a data frame in R where dates are in two different formats:
01/01/2019. These are stored as characters by default because R can't convert them to dates.
There's a pretty easy way to clean this up, however:
It's often convenient to store a password in the macOS system keychain and retrieve it inside a shell script.
Here's the bash command for setting a password:
security add-generic-password -s "Keychain item name here" -a "username here" -p
Then enter your password when prompted.
After you run this once, you can retrieve the password in a script like this:
PASSWORD=`security find-generic-password -s "Keychain item name here" -a "username here" -w`
You can then use
$PASSWORD whenever you need the password in your script.
window.location.href = 'https://threadreaderapp.com/search?q='+encodeURI(window.location.href)
Once the menu is active, you can use the arrow keys to navigate up and down, and return to select a given speaker. This allows you to tell iTunes to control a Homepod or other AirPlay 2 speaker from the keyboard.
Unfortunately there is no way I can find to automatically select a specific speaker – you have to manually do it with the arrow keys.
If you use Pipenv for Python dependency management, here's how you get
reticulate to use the proper Python executable:
library('reticulate') venv <- system("pipenv --venv", inter = TRUE) use_virtualenv(venv, required = TRUE) py_config()
py_config() command should print out the path to the Python executable in the
virtualenv created by Pipenv.