Skip to content

Instantly share code, notes, and snippets.

View janis-me's full-sized avatar
🌳

Janis Jansen janis-me

🌳
View GitHub Profile
@janis-me
janis-me / index.ts
Created November 18, 2025 05:43
Typescript generic class mixins
/**
* A generic constructor type, that returns an instance of type T
*/
type Constructor<T = {}> = abstract new (...args: any[]) => T;
/** Dummy type that is passed through surimi classes to showcase keeping types. */
type SurimiRoot = Record<string, object>;
/**
* A mixin function type that takes a base class and returns an extended class.
@janis-me
janis-me / ScrollArea.tsx
Created March 24, 2025 20:19
React/ink ScrollArea component
import { Box, DOMElement, measureElement, useFocus, useInput } from 'ink';
import { useEffect, useReducer, useRef } from 'react';
interface ScrollAreaState {
innerHeight: number;
height: number;
scrollTop: number;
}
type ScrollAreaAction =
@janis-me
janis-me / eval.js
Created October 17, 2019 12:55
Only testing js eval behaviour
console.log(1)

Keybase proof

I hereby claim:

  • I am carnageous on github.
  • I am carnageous (https://keybase.io/carnageous) on keybase.
  • I have a public key ASBdDcbFr-4lrQYvIdD2qtJVnsQeFP3S3Cm6R7VC82XA2Qo

To claim this, I am signing this object: