Skip to content

Instantly share code, notes, and snippets.

@justinmklam
justinmklam / configs-for-karabiner-layers.md
Last active December 7, 2025 17:00
Karabiner configs for macOS

Instructions:

  1. In GUI, add rule under complex modifications
  2. Change to_if_alone_timeout_milliseconds from 1000 to 500 ms

See blog post or KeymapDB for more details.

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active December 2, 2025 12:36
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@vderyagin
vderyagin / priority_queue.go
Last active November 27, 2022 18:50
Priority Queue data structure implementation in Go
package priority_queue
import "errors"
type Elem struct {
Score int
Data interface{}
}
type priorityQueue struct {