Skip to content

Instantly share code, notes, and snippets.

Base: (* = ctrl on hold)

    q*  w   e   r   t      y   u   i   o   p
    a   s   d   f   g      h   j   k   l  bks
    z   x   c   v   b      n   m   ,   .  ent*
           gui SYM sft    spc NAV alt

SYM layer (symbols)
@rstacruz
rstacruz / Arch Linux ARM on Crostini.md
Last active March 16, 2023 05:22
Arch Linux ARM on Crostini

Arch Linux ARM on Crostini

Screenshot

I got Arch Linux ARM installed on a Lenovo Chromebook Duet! I mostly used the instructions from the Arch Wiki as reference.

0. Before we begin

@rstacruz
rstacruz / README.md
Last active March 16, 2023 05:23
Next.js: loading a list of articles for a blog

Next.js: loading a list of articles for a blog

A blog might need a list of articles on its index page. Here's now I did it with Next.js.

Article files

@rstacruz
rstacruz / settings.js
Last active July 28, 2020 23:35
My VSCode settings
{
// --------------------------------------------------------------------------------
// Font settings
// --------------------------------------------------------------------------------
// Fonts
"editor.fontFamily": "Victor Mono, Iosevka, monospace", // 15/18 or 16/18
"editor.fontWeight": "600",
"editor.letterSpacing": 0,
"editor.lineHeight": 17,

Cloudflare worker example

This worker modifies the response HTML.

CloudFlare worker example

Sample CloudFlare worker that does redirects and rewrites.

Running Docker in ArchWSL

Problem: Running Docker on [ArchWSL] doesn't work by default. ArchWSL doesn't allow systemd services.

docker info
# ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

sudo systemctl start docker
# System has not been booted with systemd as init system (PID 1). Can't operate.

Opinion: Ruby's pessimistic operator

Today I realised that Ruby's >= is more useful than ~>.

Rubygems’s pessimistic operator ~>, also known as “twiddle-wakka”, allows developers to specify flexible gem version ranges.

This... Is equivalent to...
gem 'i18n', '~> 2.3.5' gem 'i18n', ‘>= 2.3.5’, '< 2.4.0'
gem 'i18n', '~&gt; 2.3' gem 'i18n', ‘&gt;= 2.3.0’, ‘&lt; 3’