Skip to content

Instantly share code, notes, and snippets.

View ruthmarks151's full-sized avatar

Ruth Marks ruthmarks151

  • Toronto Ontario, Canada
View GitHub Profile
// Let's use type annotations to examing the runtime/size of things!
// You'll have more fun if you can hover over variables and see the types for yourself.
// Copy paste into here: https://www.typescriptlang.org/play
interface SConstant { __constant_size: true }
interface SLinear<T extends string> { __variable_size: T }
interface SPlus<T extends Size, U extends Size>{ __splusand_1: T, __splusand_2: U }
interface STimes<T extends Size, U extends Size>{ __stimesand_1: T, __stimesand_2: U }
type Size = SConstant | SLinear<string> | SPlus<Size, Size> | STimes <Size, Size>
// Declare some type brands, and a union of all the possibilites
@ruthmarks151
ruthmarks151 / gitprint.js
Last active December 14, 2018 06:39 — forked from beevelop/gitprint.js
Print GitHub markdown files
document.querySelector('#readme').setAttribute('style', 'position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; background-color: white');
document.querySelector('body').appendChild(document.querySelector('#readme'));
document.querySelector('article').style.borderWidth = 0;
window.print();