Skip to content

Instantly share code, notes, and snippets.

View Gomah's full-sized avatar
⚗️

Thomas Marrec Gomah

⚗️
View GitHub Profile
@jayphelps
jayphelps / package.json
Last active May 11, 2024 00:29
TypeScript output es2015, esm (ES Modules), CJS, UMD, UMD + Min + Gzip. Assumes you install typescript (tsc), rollup, uglifyjs either globally or included as devDependencies
{
"scripts": {
"build": "npm run build:es2015 && npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:umd:min",
"build:es2015": "tsc --module es2015 --target es2015 --outDir dist/es2015",
"build:esm": "tsc --module es2015 --target es5 --outDir dist/esm",
"build:cjs": "tsc --module commonjs --target es5 --outDir dist/cjs",
"build:umd": "rollup dist/esm/index.js --format umd --name YourLibrary --sourceMap --output dist/umd/yourlibrary.js",
"build:umd:min": "cd dist/umd && uglifyjs --compress --mangle --source-map --screw-ie8 --comments --o yourlibrary.min.js -- yourlibrary.js && gzip yourlibrary.min.js -c > yourlibrary.min.js.gz",
}
}
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@clarkdave
clarkdave / load-balanced-pgbouncer-ecs.tf
Last active March 16, 2023 20:08
[Terraform] Load balanced PgBouncer service on Amazon ECS
#
# Reference implementation of a load balanced PgBouncer service on Amazon ECS
#
# see: https://engineering.loyaltylion.com/load-balanced-pgbouncer-service-on-amazon-ecs-f02120d1733e
#
resource "aws_lb" "pgbouncer" {
name = "${var.environment}-pgbouncer"
internal = true
load_balancer_type = "network"
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active May 22, 2024 08:34
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@Bleuje
Bleuje / boxzoom4.pde
Last active February 21, 2024 08:44
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
@arielsalminen
arielsalminen / package.json
Last active June 18, 2020 21:29
An example on how to use Angular and React outputTargets with Stencil.js. Please note that I’ve removed other configs in order to simplify this example. This is how we’ve configured things in https://www.duetds.com
{
"devDependencies": {
"@stencil/angular-output-target": "latest",
"@stencil/react-output-target": "latest"
}
}
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@EllyLoel
EllyLoel / reset.css
Last active April 13, 2024 18:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@jordienr
jordienr / tailwind.config.ts
Created July 15, 2023 09:10
Tailwind SVG Grid Background
// Remember to install mini-svg-data-uri
// Follow me on twitter for memes @jordienr
import { type Config } from "tailwindcss";
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette");
const svgToDataUri = require("mini-svg-data-uri");
export default {
@khalidx
khalidx / node-typescript-esm.md
Last active May 30, 2024 15:05
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json