Skip to content

Instantly share code, notes, and snippets.

View maticzav's full-sized avatar
🎉
Keep moving forward!

Matic Zavadlal maticzav

🎉
Keep moving forward!
View GitHub Profile
import path from 'node:path'
import fs from 'node:fs/promises'
import { createNoise2D } from 'simplex-noise'
import { createCanvas, createImageData } from 'canvas'
const OUTPUT_PATH = path.join(__dirname, '../../web/public/noise.png')
/**
* Creates a 200x200 canvas with a noise pattern.
# Write a program that calculates the n-th Fibonnaci number without memoization.
.data
# 0x400
N: .word 9
# 0x404
R: .word 0
.text
# PLAN:
import { PutObjectCommand, S3Client, GetObjectCommand } from '@aws-sdk/client-s3'
import * as S3 from '@aws-sdk/s3-request-presigner'
import { v4 as uuid } from 'uuid'
import { RandomUtils } from '../lib/utils/random'
export interface IAWSSource {
/**
* Gets upload parameters for a file.
*/
import { ExhaustiveSwitchCheck } from '@backend/common'
import { IActionExecution } from './execution'
import { ActionDef, ActionDefPayload, ActionDefResultDict } from './utils'
/**
* A generic interface for a service that can dispatch actions.
*/
export type IDispatcherDefinition<Definitions extends ActionDef> = {
[K in keyof Definitions]: (params: {
data: Definitions[K]['payload']