Skip to content

Instantly share code, notes, and snippets.

View theogravity's full-sized avatar

Theo Gravity theogravity

View GitHub Profile
@theogravity
theogravity / benchmark.js
Created April 25, 2023 02:07
eventemitter3 100 listeners vs 1 listener and an array of 100 callbacks
// place in https://github.com/primus/eventemitter3 benchmarks/run folder
'use strict';
var benchmark = require('benchmark');
var Master = require('../../');
function foo() {
if (arguments.length > 100) console.log('damn');
@theogravity
theogravity / objection-json-schema-to-typescript.md
Last active April 14, 2020 09:02
Generate typescript interfaces from objection.js json schema

I wanted a way to create TypeScript interfaces from the jsonSchema definition found in objection.js models and created a simple script that will allow you to do this.

Installation

I'm assuming you have your project set up to work with Typescript.

Then you will need the following packages:

npm i json-schema-to-typescript fast-glob ts-node-dev ts-node --save-dev

@theogravity
theogravity / keybase.md
Created January 14, 2018 10:30
keybase.io proof

Keybase proof

I hereby claim:

  • I am theogravity on github.
  • I am theogravity (https://keybase.io/theogravity) on keybase.
  • I have a public key ASBLsfj89d-kkP7VyHN87sskTdgU7HRLi4ZtwnLscLF5DQo

To claim this, I am signing this object: