Skip to content

Instantly share code, notes, and snippets.

Raymond Hill gorhill

  • Canada / Québec
Block or report user

Report or block gorhill

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
View background.js
var blockedRequestIds = new Set();
function(details) {
if ( details.url.includes('favicon') === false ) { return; }
console.log('blocking tabId=' + details.tabId + ' requestId=' + details.requestId + ' url=' + details.url);
return { cancel: true };
{ urls: [ '<all_urls>' ] },
View content.js
var addedNodesCount = 0;
var removedNodesCount = 0;
var observer = new MutationObserver(function(mutations) {
var i = mutations.length;
while ( i-- ) {
var mutation = mutations[i];
addedNodesCount += mutation.addedNodes.length;
removedNodesCount += mutation.removedNodes.length;
console.log('addedNodesCount=' + addedNodesCount, 'removedNodesCount=' + removedNodesCount);
gorhill / imgur.filters.txt
Created Jul 16, 2017
Clean imgur on mobile
View imgur.filters.txt ~ .GalleryHandler-postContainer > div > div[style^="width: 100%; height:"]
gorhill / gist:ef1b62d606473c68d524
Last active Aug 2, 2019
Disqus comments widget: on-demand
View gist:ef1b62d606473c68d524
! Title: Disqus click-to-load
# Copy-paste the static filters below into your "My filters" pane in the
# dashboard.
# Purpose is to load Disqus comments on demand only, so that no connection
# to `` occurs by default when you land on a site which uses
# Disqus comments widget.
# Not connecting to Disqus by default is a good thing for such a
# ubiquitous server as ``, which can be used to build a
View gist:b44bea8f9499f22c3850
mkfs.vfat -n multipass01 /dev/$DEVICE1
mount /dev/$DEVICE1 /mnt/
grub-install --no-floppy --root-directory=/mnt /dev/$DEVICE
gorhill / plusd-d3timeline.html
Last active May 6, 2019
Bar chart experiment for Wikileaks PlusD timeline graph. Uses jQuery, d3. See in action at Tested on linux Chromium & Firefox. Performance wise, Chromium does better than Firefox. Feel free to use/modify as you wish.
View plusd-d3timeline.html
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Bar chart experiment for WL_+D</title>
<script src="jquery.min.js"></script>
<script src="d3.v3.min.js"></script>
/* Nice, we can use CSS to configure appearance */
gorhill / render_number.go
Last active Jul 19, 2019
A Go function to render a number to a string based on the following user-specified criteria: thousands separator, decimal separator, decimal precision. I didn't feel it was worth to publish a library just for this piece of code, hence the snippet. Feel free to reuse as you wish.
View render_number.go
A Go function to render a number to a string based on
the following user-specified criteria:
* thousands separator
* decimal separator
You can’t perform that action at this time.