Skip to content

Instantly share code, notes, and snippets.

View ShishKabab's full-sized avatar

Vincent den Boer ShishKabab

View GitHub Profile
@ShishKabab
ShishKabab / README.md
Created March 23, 2022 18:43
Preparing Lerna workspace packages ordered by dependency

When having multiple packages in a Lerna workspace that depend on each other, Lerna does not run prepare scripts in the order of how they depend on each other. This becomes problematic when they're Typescript packages which need to be built first, so that the packages depending on them can find the type declaration files. Bug: lerna/lerna#2453

To solve this, I've created a script that outputs the packages in the workspace ordered by the dependency graph. You can then just loop over those and execute npm/yarn run prepare.

package.json puts all of these things together. Run the bootstrap script on initial install. You can also use it when you update any packages, but it may be faster to run install-dependencies if you just need to install new dependencies for any of the packages. Remeber that running yarn add or npm install in any of the workspace packages destroys the symlinks between the packages, so you need to edit package.json dependencies by hand, then run `yarn i

@ShishKabab
ShishKabab / README.md
Last active March 23, 2022 18:28
React component for a pausable image-based animation (call it a non-GIF player)

I was looking for an easy to use GIF player to play a GIF made out of a few screenshots. In the end, I decided to just make a compoment that takes in a list of image URLs, preloads them and plays them when playing the play button.

Features:

  • Loads first frame first, then the rest of them
  • Loading indicator while loading all frames
  • Seperately configurable pauses between frames and after a loop

Usage:

@ShishKabab
ShishKabab / my_memex.md
Created April 2, 2020 08:44
Pages shared through Memex
{
"presets": [
"es2015",
"react",
"survivejs-kanban"
],
"plugins": [
"transform-decorators-legacy",
"transform-class-properties",
"react-hot-loader/babel",
0x39d5521774d59fa2e46c42e99dfbef43a20d0790
0xdbb4e215c6a1b2dddbb5b67a64e0d128b19830a4
0x91927226a39d24695be3119fdde69d6483a732da
0x2f5c557fc95fd376408c9acd8e2238044ff4ec2d
0x0da6cf85addc15fedb6623d695222f421e0a146c