Skip to content

Instantly share code, notes, and snippets.

@theednaffattack
theednaffattack / Readme.md
Created November 8, 2020 21:25 — forked from leopoldodonnell/Readme.md
Install and run Postgres with an extension using docker-compose

Local Postgres

This gist is an example of how you can simply install and run and extended Postgres using docker-compose. It assumes that you have docker and docker-compose installed and running on your workstation.

Install

  • Requires docker and docker-compose
  • Clone via http: git clone https://gist.github.com/b0b7e06943bd389560184d948bdc2d5b.git
  • Make load-extensions.sh executable
  • Build the image: docker-compose build
@theednaffattack
theednaffattack / gist:ae6304695a9b17db26217775f4f879cf
Created June 17, 2021 23:35
Cursed TS Config (Error [ERR_REQUIRE_ESM]: Must use import to load ES Module:)
{
"compilerOptions": {
"target": "ES2019",
"module": "commonjs",
"lib": ["es2020"],
"sourceMap": true,
"outDir": "./dist",
"moduleResolution": "node",
"declaration": false,
"resolveJsonModule": true,
import { logger } from "./lib.logger";
type AsyncTuple<U> = [U | null, Error | null];
export async function handleAsyncTs<U extends (...args: any[]) => Promise<AsyncTuple<U>>>(func: U) {
return async function (...args: Parameters<U>): Promise<[U | null, Error | null]> {
try {
let data = await func(...args);
// If the promise succeeded but doesn't return
@theednaffattack
theednaffattack / eslint-package-json.js
Created February 21, 2022 22:45 — forked from richardtallent/eslint-package-json.js
Example eslint config in a package.json
"prettier": {
"useTabs": true,
"semi": false,
"singleQuote": false,
"bracketSpacing": true,
"trailingComma": "es5",
"printWidth": 160
},
"eslintConfig": {
"parserOptions": {
@theednaffattack
theednaffattack / xdm-solid.ts
Created February 28, 2022 16:12 — forked from CyriacBr/xdm-solid.ts
Support SolidJs inside MDX files
import { compile } from 'xdm';
import * as Path from 'path';
import * as fs from 'fs';
import * as babel from '@babel/core';
import esbuild from 'esbuild';
async function main() {
/**
* Compile MDX file with XDM
*/