I hereby claim:
- I am colophonemes on github.
- I am colophonemes (https://keybase.io/colophonemes) on keybase.
- I have a public key whose fingerprint is 14CF 549B 7C2D 5E39 7995 8795 5C57 56E6 C573 B55A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. | |
# Initialization code that may require console input (password prompts, [y/n] | |
# confirmations, etc.) must go above this block; everything else may go below. | |
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then | |
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" | |
fi | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH |
/* | |
Function to merge two people into a single person | |
The primary person (referenced by primary_person_id) will be retained, the secondary person | |
will have all their records re-referenced to the primary person, and then the secondary person | |
will be deleted | |
Note that this function may be destructive! For most tables, the records will simply be merged, | |
but in cases where merging would violate a UNIQUE or EXCLUSION constraint, the secondary person's | |
respective records will be dropped. For example, people cannot have overlapping pledges (on the |
#!/bin/bash | |
ASANA_ACCESS_TOKEN=<YOUR_ACCESS_TOKEN> | |
ASANA_PROJECT_GID=<YOUR_PROJECT_GID> | |
ASANA_CUSTOM_FIELD_GID=<YOUR_CUSTOM_FIELD_GID> | |
ASANA_WORKSPACE_GID=<YOUR_WORKSPACE_GID> | |
# relies on csv2json and jq | |
# csv2json: yarn global add csv2json | |
# jq: https://github.com/stedolan/jq | |
CSVDATA=$(csv2json -d "$1") |
const {allResponses} = inputData | |
const responsesRaw = allResponses | |
.split('###') | |
.filter(r => r) | |
.map(r => r.trim()) | |
const responses = {} | |
for (let responseRaw of responsesRaw) { | |
// split the question and answer at the first linebreak |
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income | |
FOR EACH ROW EXECUTE PROCEDURE notify_trigger( | |
'id', | |
'email', | |
'username' | |
); | |
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income | |
FOR EACH ROW EXECUTE PROCEDURE notify_trigger( | |
'id', |
This SQL creates a Postgres function to generate sequential, numeric, unique IDs in a consistent format across services. Useful for database sharding or microservices.
Draws heavily on Instagram's ID generator, via Rob Conery, with minor modifications.
The main changes are that the unique number resolution is per-second rather than per-millisecond. This is to reduce key size below 2^53^-1 so that generated IDs that are under Javascripts Number.MAX_SAFE_INTEGER
limit . This is important if you're using these on a Node.js server (e.g. our use case is an Express API using Hashids).
Max IDs are in the order of 51 bits, broken down as follows: