Skip to content

Instantly share code, notes, and snippets.

View ryan-mars's full-sized avatar
🛰️
stuck in an air lock in low martian orbit

Ryan Mierzejewski ryan-mars

🛰️
stuck in an air lock in low martian orbit
  • Elysium Planitia, Mars
View GitHub Profile
@ryan-mars
ryan-mars / machine.js
Created March 22, 2021 19:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ryan-mars
ryan-mars / fractal_design.md
Created March 21, 2021 04:00
Thoughts on the design of Fractal

What are the fundamental "primatives" of cloud native applications?

  • Distributed hash table (Dynamo)
  • Full text search (Elastic Search)
  • Large object storage
    • Write at once, or append only (S3)
    • Read-write at byte resolution (EFS)
  • Function - short duration, batch?, discrete?, pure function? (Lambda)
  • Function - indefinite duration, reentrant (Fargate)
  • Queue - records stand alone, matter more in relation to data outside the queue, think of a queue of tasks (SQS)
@ryan-mars
ryan-mars / jest-mocking-snippets.ts
Created February 19, 2021 02:15
Jest Mocking Snippets
import { X } from 'path/to/module'
jest.mock('path/to/module', () => ({
X: jest.fn()
}));
test(() => {
expect(X).toHaveBeenCalled()
})

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results