Skip to content

Instantly share code, notes, and snippets.

@molomby
molomby / cuid.sql
Created Jun 22, 2021 — forked from srfrog/cuid.sql
CUIDs for PL/PgSQL
View cuid.sql
-- Collision-resistant ids optimized for horizontal scaling and performance, for PL/PgSQL.
-- Based on https://github.com/ericelliott/cuid
-- Version 1.0.0
-- Usage: SELECT cuid();
-- BEGIN CONFIG ---
-- Put a unique host ID (int) here per server instance.
-- Once set, this value should not be changed.
@molomby
molomby / 210607 Git keys.md
Created Jun 7, 2021
Multiple Git SSH Key Pairs
View 210607 Git keys.md

Multiple Git SSH Key Pairs

This explains how to configure ssh to allow repos on multiple GitHub or BitBucket accounts to be developed on the same dev environment.

It assumes MacOS.

Basic Config

Usually, when using SSH (with git or otherwise), you'll have a single key pair for the machine you're on (eg. id_rsa). You might also define some default ssh options in your .ssh/config file.

@molomby
molomby / Keystone 5 - Secure Cookies and Reverse Proxies.md
Created Mar 31, 2020
Background and instructions for fixing cookie issues encountered when deploying Keystone 5 apps behind a reverse proxy (like nginx)
View Keystone 5 - Secure Cookies and Reverse Proxies.md

Keystone 5: Secure Cookies and Reverse Proxies

Can't sign in, eh?

TL;DR

When...

  • Keystone sessions are being used (eg. for authentication)
  • secureCookies Keystone config is true (the default when NODE_ENV is 'production')
@molomby
molomby / appending-parent-dir-name-to-filenames.md
Last active Mar 27, 2019
Docs for appending the parent directory name to the name of files it contains
View appending-parent-dir-name-to-filenames.md

Create some test files. I've assumed your filenames have a single "." character:

mkdir foo
touch foo/one.txt foo/two.txt foo/three.txt

If you list the files (ll foo) you'll get something like:

View keybase.md

Keybase proof

I hereby claim:

  • I am molomby on github.
  • I am molomby (https://keybase.io/molomby) on keybase.
  • I have a public key ASC8MmXgjzR_szIFSsEsDFuZ2X1E7GY1XP0P0v-W9ioo4wo

To claim this, I am signing this object: