Skip to content

Instantly share code, notes, and snippets.

ghing /
Last active Aug 18, 2020
User script and bookmarklet for copying current page title and URL as a Markdown link

Link copying bookmarklets and user scripts

I often want to copy the link to a page I'm viewing in the browser to the clipboard to paste it in a note or document that I'm editing. These are bookmarklets and user scripts to help with this task.

What's in here?

  • copy_markdown_link_bookmarklet.js: A bookmarklet that copies the the title and URL of the current page to the clipboard as a Markdown-formatted link. This works in Chrome, but not in Firefox, I think because "Writing to the clipboard is available without permission in secure contexts and browser extensions, but only from user-initiated event callbacks. Browser extensions with the "clipboardWrite" permission can write to the clipboard at any time." (See
  • copy_markdown_link_userscript.js: A user script that copies the the title and URL of the current page to the clipboard as a Markdown-formatted link. I wrote this because Firefox didn't seem to support providing clipboard access
ghing /
Created Mar 23, 2020
Identifying which PDFs are image vs. text

Identifying which PDFs are images vs. text

Someone who was in my PDF text extraction session at NICAR 2020 asked how to identify image vs. text PDFs when you have thousands of files and they're a mixture of formats with the end goal of only running OCR software on the image PDFs.

This is how I would approach the problem using command-line tools.


  • You’re working on a Mac or Linux machine where you have access to some common command-line utilities such as find and sed
    • This should work under the Windows Subshell for Linux under Windows also
ghing /
Created Mar 12, 2020
`CERTIFICATE_VERIFY_FAILED` in Python, on a Mac, on a computer that uses Cisco Umbrella

CERTIFICATE_VERIFY_FAILED in Python, on a Mac, on a computer that uses Cisco Umbrella

If you've ever tried to initiate an HTTPS request in Python on a Mac, perhaps usign the popular requests library, you've probably run into an exception that looks something like this:

requests.exceptions.SSLError: HTTPSConnectionPool(host='', port=443): Max retries exceeded with url: /CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/03-11-2020.csv (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

These issues are complicated by the fact that many users have multiple versions of Python installed and that there may be multiple pieces of software handling certificates.

ghing /
Last active Mar 7, 2020
The Original Pinettes during NICAR 2020

Hi NICAR friends! My friend with whom I'm staying suggested checking out an all-woman brass band called the Original Pinettes who play every Friday.

The band's Wikipedia entry ( says the Pinettes are the only all-woman brass band in New Orleans, started when the members were at a Catholic Girls school, and persisted as a band despite being disrupted by relocation caused by Katrina.

Here's the details:

Friday, March 6, 2020
Bullet's Sports Bar
2441 A P Tureaud Ave.
New Orleans, LA 70119

ghing /
Created Dec 6, 2019
Log of steps I took when installing Ubuntu 18.04 in such a way that I could use Dropbox after they dropped support for many Linux filesystems.

This is an excerpt from an install log notebook I kept when reinstalling my system that includes just the parts relevent to Dropbox.

WTF Dropbox

This whole OS installation was precipitated by the fact that Dropbox dropped support for all Linux filesystems except for plain ext4, so it wasn't working with ecryptfs and LVM and all the default ways Ubuntu sets up the filesystem.

However, Dropbox does work with full-disk encryption and an ext4 filesystem. The technology for full disk encryption under Linux is LUKS.

The key things I need to make sure happen when setting up my partitions and installing the system are:

ghing /
Created Oct 8, 2019
Installing landsat-util on MacOS with Python 3.7

Installing landsat-util on MacOS with Python 3.7

Last updated October 8, 2019.

Or don't

If you have expereince with Docker, running the Dockerized landsat-util is probably the easiest way to avoid all these dependency issues.

The problem

ghing / .bash_completion
Last active Jul 5, 2019
Make and Bash completion
View .bash_completion
# bash completion for GNU make
# This has been modified from the version in
# `/usr/local/etc/bash_completion.d/make` so that file paths are also
# autocompleted.
# To use, copy or append this to `~/.bash_completion`
have make || have gmake || have gnumake || have pmake &&
ghing /
Created Apr 4, 2011
Simple script to convert a HTTP post data copied from the Tamper Data Firefox extension into Python code that can be used in a script using the mechanize library.
We couldn’t find that file to show.
ghing / dailygraphics_markdown_links.js
Created Oct 10, 2017
Dailygraphics markdown links bookmarklet
View dailygraphics_markdown_links.js
ghing / .block
Last active Oct 6, 2017
West Virginia Referendum Results Choropleth Example
View .block
height: 800
You can’t perform that action at this time.