Skip to content

Instantly share code, notes, and snippets.

View aziraphale's full-sized avatar

Andrew Gillard aziraphale

View GitHub Profile
@aziraphale
aziraphale / ublock-origin-filter.txt
Created February 1, 2020 01:50
uBlock Origin: Hide YouTube's "Breaking news" section
! [Add this to the "My filters" section of uBlock Origin's settings]
! ### Remove YouTube's gorram "Breaking news" section ###
! ### I go to YouTube to AVOID daily bullshit, not to have it shoved in my face!! ###
! This removes page-width blocks - `<ytd-rich-section-renderer>` tags - which have a descendent somewhere with ID "title" and the text "Breaking news".
! The match on "Breaking news" uses a regular expression primarily so that it can be made case-insensitive.
! The `#title` tag we're matching looked like this, at least for me on 2020-02-01:
! <span id="title" class="style-scope ytd-rich-shelf-renderer">Breaking news</span>
! The other two `:has()` rules are just a bit of extra filtering that I hope might improve performance and/or reduce the chance of this rule matching where it's not wanted.
! YouTube is likely to change things and break this rule before too long, in which case removing `:has(:scope #dismissable)` and `:has(:scope #featured-badge)` may help.
! Note that `:scope` limits matches to
@aziraphale
aziraphale / dmesg.log
Created February 24, 2019 00:19
AGPTEK USB 3.0 HDMI Capture Box (VG0061) hardware information
New USB device found, idVendor=1bcf, idProduct=2c99
New USB device strings: Mfr=1, Product=2, SerialNumber=0
Product: FHD Capture
Manufacturer: VXIS Inc
@aziraphale
aziraphale / arrow.com-250vac-capacitor-filter-selection.js
Created October 4, 2018 21:11
JavaScript to select all ≥250VAC (or ≥400VDC) capacitors on Arrow's website
/**
* Arrow's website is currently (2018-10) pretty bad at filtering for ranges of
* values in a component property. In this case I wanted to select every
* capacitor with a voltage rating of at least 250V AC (or 400V DC). Arrow
* lets you search for a specific value, but that would only let me easily
* select, say, 250VAC capacitors, ignoring all of the 300VAC or 400VAC
* capacitors, which would be equally suitable for my purposes.
* This script uses some very simple regular expressions to compare the values
* in the <select name="Voltage"> box against an `AC_MIN` variable and a
* `DC_MIN` variable, selecting that value if it's greater than either of
@aziraphale
aziraphale / outlook-set-font-consolas.ahk
Last active September 12, 2018 10:51
Set Outlook 2016 message compose font to Consolas using Ctrl+Shift+M (AutoHotkey script)
;;;;; OUTLOOK 2016 MAIN OR COMPOSE WINDOW REDEFINE
;;;;; Redefine only when the active window is an Outlook (2016) window
#IfWinActive ahk_class rctrl_renwnd32
; Set font to Consolas with Ctrl+Shift+M
^+m::
; Outlook is a bit slow to respond!
SetKeyDelay, 100
Send !h
Send f
Send f
@aziraphale
aziraphale / AAISP-RouterOS-Bonding.rsc
Created January 27, 2018 15:15
AAISP line bonding config for a Mikrotik RouterOS router
# Note: this can't be used directly, but is a good starting point.
# Based on a Mikrotik RouterBoard RB450G.
# In my setup, one VDSL modem is connected directly to ether2, while the other goes via my core network switch on ether3.
# Ports ether3, ether4 and ether5 are bridged into an interface named "LAN", which is where all local traffic would
# come from.
# This config includes an odd third route rule which I can't explain, but I found that throughput broke when it was removed.
# This is based on bonding two lines. More can be bonded by adding more PPPoE-Client interfaces, more firewall/mangle rules,
# more routes, and by changing the "nth" parameter of the mangle rules.
# Note that this config only defines UPSTREAM traffic bonding; downstream bonding is configured by adjusting the number
# of lines selected for each IP address block in http://control.aa.net.uk/.
@aziraphale
aziraphale / config.txt
Created November 2, 2017 10:09
Smoothieboard BL Touch Configuration (with Z-Max Endstop)
gamma_min_endstop nc # Normally 1.28. Change to nc to prevent conflict,
## Z-Probe (BL Touch)
# See http://forum.smoothieware.org/forum/t-1760423/bltouch-support#post-2712545
# And http://smoothieware.org/zprobe#bltouch-or-servo-retractable-touch-probe
zprobe.enable true # set to true to enable a zprobe
zprobe.probe_pin 1.28 # pin probe is attached to if NC remove the !
zprobe.slow_feedrate 5 # mm/sec probe feed rate
zprobe.fast_feedrate 100 # move feedrate mm/sec
zprobe.probe_height 5 # how much above bed to start probe
@aziraphale
aziraphale / config.txt
Created November 2, 2017 10:09
Smoothieboard BL Touch Configuration
gamma_min_endstop nc # Normally 1.28. Change to nc to prevent conflict,
## Z-Probe (BL Touch)
# See http://forum.smoothieware.org/forum/t-1760423/bltouch-support#post-2712545
# And http://smoothieware.org/zprobe#bltouch-or-servo-retractable-touch-probe
zprobe.enable true # set to true to enable a zprobe
zprobe.probe_pin 1.28 # pin probe is attached to if NC remove the !
zprobe.slow_feedrate 5 # mm/sec probe feed rate
zprobe.fast_feedrate 100 # move feedrate mm/sec
zprobe.probe_height 5 # how much above bed to start probe
@aziraphale
aziraphale / email.html
Created May 30, 2016 20:13
magic "Confirm Subscription" link in Google Inbox for Mailchimp subscription confirmation email
<!-- Google Inbox displayed a "Confirm Subscription" link button immediately below the subject line, both when the
email was opened and when it was closed. Clicking the button would confirm the subscription without the browser
visibly opening the confirmation link. -->
<span itemscope itemtype="http://schema.org/EmailMessage">
<span itemprop="description" content="We need to confirm your email address."></span>
<span itemprop="action" itemscope itemtype="http://schema.org/ConfirmAction">
<meta itemprop="name" content="Confirm Subscription">
<span itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
<meta itemprop="url" content="https://carloop.us6.list-manage.com/subscribe/smartmail-confirm?u=...&id=...&e=...&inline=true">
@aziraphale
aziraphale / header-references.md
Last active April 22, 2016 13:18
123D Circuits Header Component References

Dimensions Notes

(Numbers in {} refer to 2.0mm-pitch - vs. 2.54mm elsewhere)

THT Pads

  • Roundness: 1000 µ
  • Width: 1500 {1200} µ
@aziraphale
aziraphale / gz2bz2.php
Created January 11, 2016 16:13
PHP script to convert .gz-compressed files to .bzip2 utilising the system's existing `gunzip` and `bzip2` commands
<?php
/**
* Fixes PHP's $argv array (or, rather, a list of filenames that is assumed to
* come from $argv) to expand glob strings on Windows, where the cmd.exe shell
* doesn't expand globs before passing arguments to called commands/programs.
*
* @link https://gist.github.com/aziraphale/edf8a1b1ad049f4e08ee
* @param array $argv
* @return array