Skip to content

Instantly share code, notes, and snippets.

@natanlao
natanlao / ccpa.md
Last active Apr 14, 2021
CCPA wall of shame
View ccpa.md

Over the last few months, I've been cleaning up after myself and filing CCPA requests where I can. Here are some of the less-friendly companies that I've encountered in this process.

Sift

Signed me up for marketing emails using the email address I provided for my CCPA request.

Equifax

The worst one of them yet.

@natanlao
natanlao / github-global-node-id.md
Last active Apr 7, 2021
Translating GitHub resource IDs to global node IDs
View github-global-node-id.md

GitHub associates a unique resource ID (or "database ID" or just "ID") with each API-accessible resource. For example, each [issue][issue-id], [repository][repository-id], and [user][user-id] has a global ID. In my limited experience with it, GitHub's REST API generally does not expose endpoints by which resources can be queried by ID (though it does have some [undocumented endpoints][repo-rest]). These resource IDs have been superseded by distinct [global node IDs][global-ids] (node_id). GitHub's GraphQL API allows retrieval of a node by its ID, called a "direct node lookup".

As you can tell, you likely don't have much reason to interact with the older

@natanlao
natanlao / volume.md
Last active Apr 4, 2021
docker-compose: no declaration was found in the volumes section
View volume.md

If, when doing something like docker-compose up, you run into an error like this:

ERROR: Named volume "server/db:/usr/share/nginx/html/db:rw" is used in service "web" but no declaration was found in the volumes section.

You're missing a leading ./, so, for example:

volumes:
 - 'server/db:/usr/share/nginx/html/db'
@natanlao
natanlao / dependabot.md
Last active Apr 2, 2021
Automatically merging Dependabot PRs
View dependabot.md

The best way I've found to automatically merge Dependabot PRs is to use actions/github-script to comment @dependabot merge on Dependabot PRs. There are a few reasons why I think this approach makes sense:

  • Commenting @dependabot merge on a Dependabot PR instructs Dependabot to merge the PR after tests (if any) pass, so we don't need to encode that dependency in a workflow file.

  • Unlike using an auto-merge action, nothing happens if the workflow runs on a

@natanlao
natanlao / dokku.md
Last active Mar 30, 2021
Dokku reference
View dokku.md

I host side projects on a DigitalOcean droplet running Dokku. For reference:

One-time setup of Lets Encrypt

$ ssh root@platform.natan.la sudo dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git
$ ssh dokku@platform.natan.la dokku letsencrypt:cron-job --add

Creating an app

@natanlao
natanlao / followups.md
Last active Mar 13, 2021
Job application follow-up emails
View followups.md
@natanlao
natanlao / uc-dcp.md
Last active Jan 20, 2021
Guide to the Defined Contribution Plan for UCSC undergraduates
View uc-dcp.md

Guide to the Defined Contribution Plan for UCSC undergraduates

First, a disclaimer: I am neither a lawyer nor a financial adviser, and if I were, I wouldn't be your lawyer or financial adviser. This is neither financial advice nor legal advice. I didn't even study this stuff.

That said, I've provided sources where appropriate. In particular, I'll refer to these documents:

  • this UCSC Career Center [Defined Contribution Plan documentation][cc], which
@natanlao
natanlao / arq-ssh.md
Last active Jan 3, 2021
Generating SSH keys that will work with Arq
View arq-ssh.md

Generating SSH keys with Arq

Tested with Arq 5.

I encountered some issues trying to add my existing SSH key pairs with Arq. I saw errors like:

[path to key]: Key 'OPENSSH' is not supported.

or

View apple-recovery-keys.md

Cannot add Apple recovery key

iPhone XR, iOS 14.2

Problem

To add a recovery key to your Apple account, you must record the provided recovery key, then enter it again to confirm that you have recorded it. In some cases, however, even if you verify the recovery key correctly (i.e., enter the exact recovery key provided) Settings.app may complain that you didn't:

@natanlao
natanlao / vanilla.md
Created Nov 28, 2020
Warning about Vanilla eGift Cards
View vanilla.md

If you receive a Vanilla eGift Card, you should know that the link to the page with your eGift card details will expire after some weeks. The link can supposedly be reissued, but it must be requested by the person who purchased you the eGift card over the phone. So, best to save the card details somewhere once you receive them.

The eGift Card funds are advertised as never expiring. It's not clear to me if that guarantee holds for funds left inactive for a long period of time.