Skip to content

Instantly share code, notes, and snippets.

Sean Hammond seanh

Block or report user

Report or block seanh

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
@seanh
seanh / README.markdown
Last active Jul 1, 2018
How to set up unattended upgrades with email notifications on Ubuntu
View README.markdown
@seanh
seanh / raw_html_elements_on_github.md
Last active Jan 23, 2018
Raw HTML Elements You Can Use on Github
View raw_html_elements_on_github.md

Raw HTML Elements You Can Use on Github

GitHub Gist (and anywhere else where HTML is rendered on GitHub) allows you to use any of the HTML elements that GitHub Flavored Markdown (GFM) provides syntactic sugar for. You can either use the syntactic sugar that GFM (or other GitHub-supported markup language you're using) provides or, since Markdown can contain raw HTML, you can enter the HTML tags manually.

GitHub also allows you to use a few HTML elements beyond what Markdown provides by entering the tags manually, and some of them are styled with CSS. Most raw HTML tags get stripped before rendering the HTML. Those tags that can be generated by GFM synactic sugar, plus a few more, are whitelisted. These aren't documented anywhere that I can find. Here's what I've discovered so far:

  • Sample or quoted outpu

@seanh
seanh / README.markdown
Last active Jul 1, 2018
Mozilla Thunderbird Keyboard Shortcuts
View README.markdown

Mozilla Thunderbird Keyboard Shortcuts

Thunderbird actually has fairly complete keyboard shortcuts. The schema is all over the place, there's little consistency to the design of the keyboard shortcuts, and frequently needed shortcuts are often out-of-the-way keys or difficult to hit multi-key combos, but the shortcuts do cover a lot of the app's functionality. You can't do everything with the keyboard, you'll have to reach for the mouse sometimes, but a lot can be done from the keyboard in Thunderbird.

@seanh
seanh / how-the-client-is-configured.markdown
Last active Jun 16, 2017
How the Hypothesis client configures itself
View how-the-client-is-configured.markdown

How the client is configured

There are several different files in the client source code that read configuration (also sometimes called "options" or "settings") from different places.

An additional difficulty is that the client consists of two separate components:

  1. The code in src/annotator/ is JavaScript code that's injected directly
@seanh
seanh / README.markdown
Last active Sep 16, 2017
Embedding Hypothesis in a Single Page App
View README.markdown

This is a very rough demonstration of how to embed Hypothesis in a single page app.

When you click on the "Go to page two" button it loads the second "page" of the app. This page is just loaded by JavaScript, without having the browser load a new page as it would normally do when following a link. Importantly the JavaScript code does change URL in the browser's location bar though, using history.pushState(). Before changing the URL it unloads Hypothesis from the page, and after changing the URL it reloads Hypothesis into the page. This is to work around a limitation with Hypothesis - it doesn't detect URL changes done by pushState() and reload the annotations.

@seanh
seanh / contentScript.js
Last active Dec 22, 2015
Chrome extension PDF detection with GET request from event page and using activeTab permission
View contentScript.js
/**
* Check if the request is a PDF file.
* @param {Object} details First argument of the webRequest.onHeadersReceived
* event. The properties "responseHeaders" and "url"
* are read.
* @return {boolean} True if the resource is a PDF file.
*/
function isPdfFile(response, url) {
var header = response.getResponseHeader('content-type');
if (header) {
@seanh
seanh / 2645a9c857af1402bf63.crx
Last active Dec 22, 2015
Chrome extension PDF detection with GET request from event page
@seanh
seanh / 27bdaa36aca3b6d6ffa9.crx
Last active Dec 22, 2015
Chrome extension PDF detection with GET request from content script
@seanh
seanh / 85c02c1a0f309abab988.crx
Last active Dec 22, 2015
Chrome extension PDF detection with webRequest
You can’t perform that action at this time.