Skip to content

Instantly share code, notes, and snippets.

Raymond Hill gorhill

  • Canada / Québec
View GitHub Profile
View rising_smears.md

In the end it finally dawned on me that I had been blinded by propaganda, and that Assange had been systematically slandered to divert attention from the crimes he exposed.

-- Nils Melzer in Demasking the Torture of Julian Assange

Krystal Ball & Saagar Enjeti

A proper retraction of the smears against Julian Assange parroted on the TV show Rising on November 16, 2018, is the least to expect from Krystal Ball & Saagar Enjeti, who have otherwise been great at calling bullshit from main stream media.

a

View background.js
var blockedRequestIds = new Set();
browser.webRequest.onBeforeRequest.addListener(
function(details) {
if ( details.url.includes('favicon') === false ) { return; }
blockedRequestIds.add(details.requestId);
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
gorhill / imgur.filters.txt
Created Jul 16, 2017
Clean imgur on mobile
View imgur.filters.txt
m.imgur.com##.GalleryHandler-postContainer ~ .GalleryHandler-postContainer
m.imgur.com##.getTheApp
m.imgur.com##.FloatingOIA-container
m.imgur.com##.GalleryInfiniteScroll > div > div[style^="width: 100%; height:"]
@gorhill
gorhill / gist:ef1b62d606473c68d524
Last active May 14, 2020
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 `disqus.com` 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 `disqus.com`, which can be used to build a
View gist:b44bea8f9499f22c3850
||connectormwi.laterpay.net/*/app-de-de.js$script,domain=sport1.de
View grub-install.sh
#!/bin/sh
DEVICE=sdf
mkfs.vfat -n multipass01 /dev/$DEVICE1
mount /dev/$DEVICE1 /mnt/
grub-install --no-floppy --root-directory=/mnt /dev/$DEVICE
@gorhill
gorhill / plusd-d3timeline.html
Last active May 6, 2019
Bar chart experiment for Wikileaks PlusD timeline graph. Uses jQuery, d3. See in action at http://jsfiddle.net/khnxZ/#. 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>
<html>
<head>
<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>
<style>
/* Nice, we can use CSS to configure appearance */
@gorhill
gorhill / render_number.go
Last active May 5, 2020
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
/*
Author: https://github.com/gorhill
Source: https://gist.github.com/gorhill/5285193
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.