--dangerously-skip-permissions, minus your machine.
$ brew install byre
$ cd ~/my-project && byre develop
No byre.config here — let's set one up (press Enter to accept [default]).
Template — go node python none [node]:
| /* | |
| # WHAT | |
| Do a pre-pass of tagged template literals, interpolating strings | |
| # WHY | |
| Consider Prisma's `$queryRaw()`; it accepts a tagged template literal, and |
| /* | |
| # Why | |
| Asynchronously instantiate a singleton only once, even if many calls are made, | |
| eg, a handler that lazy-loads a resource, but might be called several times | |
| before it's ready. | |
| # Synopsis |
| // Offensively simple shim on top of https://www.npmjs.com/package/connect-pg-simple | |
| import { PrismaClient } from '@prisma/client'; | |
| import connectPgSimple from 'connect-pg-simple'; | |
| import session from 'express-session'; | |
| import { format } from '@scaleleap/pg-format'; | |
| type Debugger = (arg: Record<string, unknown>) => Promise<void>; | |
| export const consoleDebugger: Debugger = async (payload) => { |
The Pecol (Pete's Columns) is a text-based format designed for handling structured data on the command line. It is similar to TSV, but adds some additional structure in the form of type annotations for each column.
The Pecol format is particularly well-suited for use on Linux systems, where it can be used in conjunction with various command line tools for data processing and analysis.
Each Pecol file starts with a magic string on the first line, followed by a header row and one or more data rows.
| #!perl | |
| # Dictionary encrypted so the keys aren't enumerable, but where possession of | |
| # a key allows you to decrypt the value. | |
| # | |
| # eg: a translations file where you don't want people to be able to know all | |
| # the translated strings, but you do want someone with a string to be able | |
| # to translate it | |
| use strict; |
| #!perl | |
| use strict; | |
| use warnings; | |
| # key insights: | |
| # | |
| # * things having to happen "simultaneously" is misleading. Because we only add | |
| # into the middle each time, you can start with each pair, work out what | |
| # happens there, and then move on to the next one |
| const wrapP = <T>( x: T ) : Promise<T> => Promise.resolve(x); | |
| const wrapL = <T>( x: T ) : T[] => [x]; | |
| const foo = wrapP("string"); // Promise<string> | |
| const bar = wrapL(5); // number[] | |
| // PS: you can also add constraints |
adet attempts to provide maximum DWIM for projects using docker, Docker
Compose and AWS ECS from YAML configuration files. It supports the three
projects I'm working on nicely, each one of which has several component
Docker images organized into tasks and services, and deployed on ECS.