Alisdair McDiarmid

alisdair.mcdiarmid.org · Personal blog · on HN since 2012

Alisdair McDiarmid writes programming notes on ARM encoding and C JSON parsing, and is known for the Kill Sticky Headers bookmarklet.

What HN saysHN repeatedly recommends the Kill Sticky Headers bookmarklet, with users saying one click removes annoying sticky navbars and popups.
78HN people shared it
69linked it in comments
18stories submitted
1.1Kstory points
5 months agolast shared
2012people per year2026

Most-shared posts

  1. 1
    Kill sticky headers (2013)
    70 people · 700 points · first shared 2015 · 116 comments on HN
  2. 2
    ARM immediate value encoding (2014)
    4 people · 180 points · first shared 2015 · 41 comments on HN
  3. 3
    ARM immediate value encoding
    1 people · 181 points · first shared 2014 · 70 comments on HN
  4. 4
    Kill sticky headers
    1 people · 3 points · first shared 2014 · discussion on HN
  5. 5
    It is our responsibility to teach
    1 people · 2 points · first shared 2013 · discussion on HN
  6. 6
    Jsmn example: parsing JSON with C
    1 people · 2 points · first shared 2016 · discussion on HN
  7. 7
    Jsmn example
    1 people · first shared 2012

What HN people wrote when they linked it

nmca · 2018-08-07
"kill sticky" is amazing for this. One click gets most annoying stuff. https://alisdair.mcdiarmid.org/kill-sticky-headers/
mabcat · 2017-11-06
I have a "Kill Sticky" bookmarklet to do that job, as the first thing on my bookmarks toolbar. I'm clicking that thing all the time, it works great. So long stupid sliding navbars, enter-your-email popups, fixed video autoplayers, etc. I think I got it from here: https://alisdair.mcdiarmid.org/kill-sticky-headers/
johansch · 2017-09-18
Since I enjoyed using this bookmarklet on this site, I thought I'd recommend it to others as well: https://alisdair.mcdiarmid.org/kill-sticky-headers/
illnewsthat · 2017-08-11
This is fantastic, thanks! I started using this "Kill Sticky Headers" [0] I saw on HN once and I find it very useful. I'll give the ublock list a try. [0] https://alisdair.mcdiarmid.org/kill-sticky-headers/
endemic · 2017-06-20
Obligatory link to a "kill sticky headers" bookmarklet: https://alisdair.mcdiarmid.org/kill-sticky-headers/ This has saved me a great deal of annoyance, especially on my smaller-screened mobile phone.
twic · 2016-05-02
However, many of the later RISC architectures do share one annoying flaw. [...] the mechanism for storing 32-bit immediates can only encode a 32-bit value by splitting it across two instructions: a "load high" followed by an "add". [...] This design pattern turns up on almost all RISC architectures, though ARM does it differently (large immediates are accessed by PC-relative loads). He neglects to mention the ARM's clever approach to this: https://alisdair.mcdiarmid.org/arm-immediate-value-encoding/
userbinator · 2017-05-27
The one thing that immediately caught my eye is the lack of fixed-width-ness (for lack of a better term) in the value displays. IMHO besides being somewhat annoying to read it can be rather misleading, which is bad especially for something "designed specifically to use as a teaching tool". It's misleading because it doesn't show that the storage for the values is fixed-width. For example, this clearly shows that the registers are 32 bits and never anything but: R0 0000BEEF R1 000BEEF0 R2 000000BE R3 00000001 R4 BEEF0000 R5 00005F77 R6 00000000 R7 00000000 ... I've taught Asm before and seen so many students get this wrong that it's worth calling out. In fact the right example under the "Error Correction Suggestions" section gets this wrong too --- that's an assembly/syntax error, not a runtime error. (ARM's immediate value encoding is also worth looking at if you haven't seen it before, since it's not just a single 32-bit value either: https://alisdair.mcdiarmid.org/arm-immediate-value-encoding/ ) The other thing that I'd suggest as an improvement is a 16-byte-hexdump mode with ASCII on the right for "View Memory Contents". Other than that, with perhaps the exception of "infinite loop detection", the other features look useful.
gibspaulding · 2026-03-18
This only really works easily on desktop and requires a click, but is very satisfying to use: https://alisdair.mcdiarmid.org/kill-sticky-headers/
meatmanek · 2025-08-06
12 years later, https://alisdair.mcdiarmid.org/kill-sticky-headers/ is still super useful.
adiabatty · 2024-03-24
https://alisdair.mcdiarmid.org/kill-sticky-headers/ Also, to nicely format the Jira issue I'm looking at, to paste into task trackers: javascript: (() => { const tagEl = document.querySelector( '[data-testid="issue.views.issue-base.foundation.breadcrumbs.current-issue.item"]' ); if (!(tagEl instanceof HTMLElement)) return; const tag = tagEl.innerText; const nameEl = document.querySelector( '[data-testid="issue.views.issue-base.foundation.summary.heading"]' ); if (!(nameEl instanceof HTMLElement)) return; const name = nameEl.innerText; const text = `[${tag}] ${name}`; navigator.clipboard.writeText(text); })();
cf100clunk · 2023-10-21
Thank goodness I have Kill Sticky bookmarked as below (one string) for sites like this: javascript:(function()%7B(function () %7Bvar i%2C elements %3D document.querySelectorAll('body *')%3Bfor (i %3D 0%3B i < elements.length%3B i%2B%2B) %7Bif (getComputedStyle(elements%5Bi%5D).position %3D%3D%3D 'fixed') %7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)() https://alisdair.mcdiarmid.org/kill-sticky-headers/
kimixa · 2023-10-05
You don't even need unusual architectures - e.g. it's pretty easy to find a constant that might be fast to encode a value as 2 immediate and store the value in memory as two halfword stores on ARM - see https://alisdair.mcdiarmid.org/arm-immediate-value-encoding/ for the immediate encoding. It might be quicker than loading those immediates into a register, shifting and or-ing them as necessary, and then doing a single store. Especially if your focus is on code size (for small platforms or cache utilization reasons). An I wouldn't be surprised if there's some weird x86 encoding that in some cases helps code size similarly, with different encoded instruction lengths allowing for different immediate sizes.
bxparks · 2023-06-02
I didn't even realize that "Whatever" was the dismiss button. The Kill Sticky bookmarklet is your friend: https://alisdair.mcdiarmid.org/kill-sticky-headers/ There's a newer version, but it breaks a number of sites for me, so I don't use it: https://github.com/t-mart/kill-sticky The internet is a hostile place without Kill Sticky, uBlock Origin, and uBlock Matrix.
jabroni_salad · 2023-04-24
NTHNer but here is the one I use. It's old but it still works a treat: https://alisdair.mcdiarmid.org/kill-sticky-headers/ (function () { var i, elements = document.querySelectorAll('body *'); for (i = 0; i < elements.length; i++) { if (getComputedStyle(elements[i]).position === 'fixed') { elements[i].parentNode.removeChild(elements[i]); } } })();
dailykoder · 2022-07-15
Just a quick reminder to keep this in your bookmarks: https://alisdair.mcdiarmid.org/kill-sticky-headers/ A life safer especially on the rare occassions where I am using my old thinkpad with 1386x720 resolution.
lysozyme · 2022-06-04
I’ve tried a lot of ad blockers over the years. Browsing mainstream news on the internet, in particular, highlights the absolute cesspool of pop ups and auto-playing videos that characterize the contemporary web. None, least of all Stop the Madness, have worked as well and on as many devices as this simple bookmarklet, whose author I don’t know but who has saved me countless aggravations javascript:(function%20()%20%7B%20var%20i,%20elements%20=%20document.querySelectorAll('body%20*');%20%20for%20(i%20=%200;%20i%20%3C%20elements.length;%20i++)%20%7B%20if%20(%5B%22sticky%22,%20%22fixed%22%5D.includes(getComputedStyle(elements%5Bi%5D).position))%20%7B%20elements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D);%20%7D%20%7D%20%7D)(); Edit: credit to the original author [1] and thank you! 1. https://alisdair.mcdiarmid.org/kill-sticky-headers/
marcodiego · 2022-03-07
For this and other cases, I use this extension: https://alisdair.mcdiarmid.org/kill-sticky-headers/
pvity · 2022-02-12
> Chrome without uBlock (or any browser really) is unusable. I use a recent version of Safari and uBlock origin doesn't work there. I rely on Ka-Block![1], which blocks popular ad serving domains. For other annoyances like newsletter popups, etc., I use a "Kill sticky headers" script[2], with some hacks; I'll try to post my version of that script sometime soon. It works good enough for my needs. I also have Firefox with uBlock installed, but with that earlier setup I end up still using Safari. [1]: https://github.com/dgraham/Ka-Block [2]: https://alisdair.mcdiarmid.org/kill-sticky-headers/
overlordalex · 2022-01-06
> The amount of those popups elements I have hidden using ublock with right click, it's staggering. I have a bookmarklet saved that simply deletes fixed elements, making it faster and easier to get rid of those[0]. However I have noticed sites are starting to make their banners more akin to shrinkwrap agreements where they state that dismissing the popup or continuing to read without making a choice is equivalent to acceptance. [0] What I find most interesting is how many websites become much more readable by this - I hate sites that use a good third of the screen real-estate for headers and footers, nevermind those awful menus that only appear on scroll-up and cover the top few lines of content. https://alisdair.mcdiarmid.org/kill-sticky-headers/
JetSetWilly · 2021-11-23
That's where the "kill sticky headers" smart bookmark comes in handy: https://alisdair.mcdiarmid.org/kill-sticky-headers/
dreamcompiler · 2021-10-01
Kill Sticky bookmarklet is your friend. https://alisdair.mcdiarmid.org/kill-sticky-headers/
HanyouHottie · 2021-08-24
You can make a bookmark called "Kill Sticky" or something and put this in it [1]: javascript:(function()%7B(function%20()%20%7Bvar%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7Bif%20(getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'fixed')%20%7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)() It will delete any fixed headers and footers on your current page. [1]:https://alisdair.mcdiarmid.org/kill-sticky-headers/
cxr · 2021-08-20
It is a problem[1][2]. Desktop is the only use case I even had in mind. I only threw in the mobile/desktop mention in order to reference what mobile browsers do with the address bar and a last minute thought about how the availability of a mouse pointer presents the opportunity to add a little polish. Sticky headers, whether on mobile or desktop, are worse than animated banners. 1. https://alisdair.mcdiarmid.org/kill-sticky-headers/ 2. https://news.ycombinator.com/item?id=21699871
tsjq · 2021-08-10
I use the Kill-Sticky bookmarklet for this and all other intrusive stickies, floaties, etc https://alisdair.mcdiarmid.org/kill-sticky-headers/
cabalamat · 2021-06-28
I don't like stikcy header,s so I use the Kill Sticky bookmarklet ( https://alisdair.mcdiarmid.org/kill-sticky-headers/ ) When I do this, some websites do the same thing, i.e. don't let me scroll down. I think calling this the Fuck You pattern is entirely appropriate.
eythian · 2021-06-11
This generally handy bookmarklet solved it for me: https://alisdair.mcdiarmid.org/kill-sticky-headers/
nathanasmith · 2021-03-22
>That would be topbars that disappear when scrolling down and then reappear if you scroll up This is close to my biggest pet peeve on the internet. Fortunately, the "kill sticky" bookmarklet[0] gets rid of those as well as other fixed elements on the page. Works on iOS too. [0]https://alisdair.mcdiarmid.org/kill-sticky-headers/
cristoperb · 2021-02-11
In desktop browsers I use this "kill sticky" bookmarklet: https://alisdair.mcdiarmid.org/kill-sticky-headers/
scaryclam · 2020-08-27
Here's a link for something I use on such news and blog sites: https://alisdair.mcdiarmid.org/kill-sticky-headers/ I works a surprising amount of the time!
myfonj · 2020-06-14
For "manual" cleanup I'm using slightly extended universal "Sweep Stickies" bookmarklet [1], based on idea taken from "Kill Sticky" [0]. Removes generally all those banners and overlays obscuring content and eating viewport. (Userscript available [2], but I prefer good old bookmarklet way for this.) It literally crawls all elements in page, tests their computed style and removes those with sticky position (and a bit more). Works quite well for me. [0] https://alisdair.mcdiarmid.org/kill-sticky-headers/ [1] http://myfonj.github.io/utils/bookmarklets/sweep-stickies.html [2] https://greasyfork.org/en/scripts/370572-sweep-stickies

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close