Skip to content

Instantly share code, notes, and snippets.

@arccoza
arccoza / index.js
Last active March 20, 2024 15:12
JavaScript Callable Object using proxy
'use strict'
class Callable extends Function {
constructor() {
super()
return new Proxy(this, {
apply: (target, thisArg, args) => target._call(...args)
})
}
@uhop
uhop / build-index.js
Last active April 29, 2021 12:19
Modern/legacy builds with webpack
'use strict';
if (process.argv.length < 3) {
console.log('Usage: node build-index.js inFile outFile');
console.log(' All file names are relative to the project directory.')
console.log('Example: node build-index.js src/index.html docs/index.html');
process.exit(1);
}
const fs = require('fs');
@popravich
popravich / PostgreSQL_index_naming.rst
Last active March 25, 2024 12:42
PostgreSQL index naming convention to remember

The standard names for indexes in PostgreSQL are:

{tablename}_{columnname(s)}_{suffix}

where the suffix is one of the following:

  • pkey for a Primary Key constraint;
  • key for a Unique constraint;
  • excl for an Exclusion constraint;
  • idx for any other kind of index;