Skip to content

Instantly share code, notes, and snippets.

ciaranmcnulty /
Last active March 25, 2024 06:36
Notes on using Docker on ARM Macs (November 2021)

Docker for Mac

On M1 machines, Docker for Mac is running a lightweight linux ARM VM, then running containers within that, so containers are essentially running natively. Don't be fooled by the fact the UI or binary CLI tools (e.g. docker) might require Rosetta.

Within that VM is an emulation layer called QEmu. This can be used by docker to run Intel containers. This does not use Rosetta at all, and has a roughly 5-6X performance penalty. (If you just upgraded your CPU this may result in a similar performance to your old machine!)

Pulling and running with Docker

Many images in public registries are multi-architecture. For instance at the time of writing on Docker Hub the php:8.0-cli image has the following digests:

adliwahid /
Created April 17, 2016 10:27
httrack for mirroring site on (waybackmachine)
#this is useful for copying snapshotted sites at
#copied from
#replace ${wayback_url} with the full URL i.e.
#replace ${domain_name} with the domain name of the site you'r mirroring without the 'http', so
magicznyleszek /
Last active March 29, 2024 01:12
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
figgis /
Last active June 14, 2023 08:46
H.265/HEVC bitstream parser
#!/usr/bin/env python
- ae(v): context-adaptive arithmetic entropy-coded syntax element. The parsing process for this descriptor is
specified in clause 9.3.
- b(8): byte having any pattern of bit string (8 bits). The parsing process
for this descriptor is specified by the return value of the function
read_bits( 8 ).
- f(n): fixed-pattern bit string using n bits written (from left to right)

If you import live data into Google Docs spreadsheets using the importdata function and you want to force a refresh at a certain interval, but you also want to ensure that some cache-busting goes on, append a querystring that's the epoch time value that the refresh occurs, so for a sheet that should grab new data every hour you could force an update like this:

importData("" & hour(googleclock()) & ")")

But the url requested looks like this: if the refresh happened at 11am. The next day at 11, the url will be the same, so there's a chance you may get cached data. To get around this, use an epoch time-based refresh. The formula:

=((date(year(googleclock()),month(googleclock()),day(googleclock())) & " " & time(hour(googleclock()), 0, 0)) - DATE( 1970;1;1))*86400

gives you the epoch timestamp for the time at the current hour. If you wanted the timest

biesnecker / config.rb
Created February 17, 2013 09:31
Wiki-like automatic links for Middleman
# add this to your config.rb
ready do
wikitargets =
wikiwords = {|p| p.ext == ".html" }.each do |p|
wikitargets[['wikitag']] = p.url