Skip to content

Instantly share code, notes, and snippets.

Saxes Parser State Machine

stateDiagram-v2

  # Consume optional 0xFEFF char
  BEGIN

  # Only space characters are allowed outside root element
 TEXT
export EDITOR='code_wait_new_window'
export VISUAL='code_wait_new_window'

There are now 3 modes for versioning

  • UNAMBIGUOUS - This is the default now, it will succeed only if it would make no difference which of the other two modes you chose. If the other two modes would have different outcomes, it will fail the release and force you to specify a mode.
  • ALWAYS_INCREASING - This mode is best for publishing applications, it also most closely resembles the behaviour of Rolling Versions before this change. It will treat the maximum published version as the current version, regardless of which branch you are releasing from. This means that each new release is guaranteed to have a higher version number than the previous release.
  • BY_BRANCH - This mode can be useful for libraries. It allows you to create separate branches for different major versions, and release patches to old major versions. When determining the current version, it will only consider git tags/versions that were released on the current branch. This makes it possible to release 1.0.1 after having already releas
{
"attributes": {"hello": "world"},
"data": {"my": "event"}
}
@ForbesLindesay
ForbesLindesay / pg-typed.ts
Created February 25, 2021 18:07
pg-typed doesn't have docs yet, here's the types with some comments to get you started.
import type { SQLQuery, Queryable } from '@databases/pg';
/**
* A query for multiple records that has not yet been sent to the database
*/
export interface SelectQuery<TRecord> {
all(): Promise<TRecord[]>;
orderByAsc(key: keyof TRecord): OrderedSelectQuery<TRecord>;
orderByDesc(key: keyof TRecord): OrderedSelectQuery<TRecord>;
select<TKeys extends (keyof TRecord)[]>(...fields: TKeys): SelectQuery<Pick<TRecord, TKeys[number]>>;
@ForbesLindesay
ForbesLindesay / benchmark.js
Created January 30, 2021 14:08
Array vs. Double Array for Queue
function testSimpleArray(size) {
const results = [];
let queue = [];
for (let run = 0; run < 10000; run++) {
for (let i = 0; i < size; i++) {
queue.push(i);
}
for (let i = 0; i < size; i++) {
results.push(queue.shift());
}
// based on: https://github.com/brianc/node-postgres/blob/a536afb1a8baa6d584bd460e7c1286d75bb36fe3/lib/client.js#L275-L299
function safeText(str: string) {
let hasBackslash = false;
let escaped = `'`;
for (const c of normalizeUnicode(str)) {
if (c === `'`) {
escaped += c + c;
} else if (c === `\\`) {
escaped += c + c;
import leven from 'leven';
import {Result, error, ErrorResult} from './ParserTypes';
export default class StringInput {
public readonly index: number;
public readonly value: string;
constructor(index: number, value: string) {
this.index = index;
this.value = value;
}
{
"dependencies": {
"@databases/pg-test": "^0.0.1",
"jest": "^24.1.0"
},
"pg": {
"test": {
"migrationsScript": ["yarn", "migrations", "up"]
}
},

Getting Started

Install the GitHub App

To get started, you will need to install the GitHub App. This allows us to detect pull requests, comment on your pull requests with a preview of the change log, update build statuses, and trigger GitHub actions workflows if you use them for releases.

INSTALL CTA GOES HERE

**Selector to choose between GitHub actions and Circel CI, styled somethign like https://twitter.com/steveschoger/status/1024720091546562560/photo/1 **