Skip to content

Instantly share code, notes, and snippets.

@jaredh159
Last active March 5, 2020 16:03
Show Gist options
  • Save jaredh159/f46af8aa46982816c6a05a28db57693f to your computer and use it in GitHub Desktop.
Save jaredh159/f46af8aa46982816c6a05a28db57693f to your computer and use it in GitHub Desktop.
Useful snippets!

make a one-pixel gif of any color in node.js

function gif(r, g, b) {
  return 'R0lGODlhAQABAIAB' +
    (new Buffer([0, r, g, b, 0, 0])).toString('base64') +
    'ACwAAAAAAQABAAACAkQBADs=';
}
// then use: data:image/gif;base64,R0lGODlhAQABAIABAPLy8gAAACwAAAAAAQABAAACAkQBADs=

draw arbitrary svg curves

https://codepen.io/anthonydugois/pen/mewdyZ

Infer component props from component in React

type InferredProps = React.ComponentProps<typeof MyComponent>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment