This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write a program that calculates the n-th Fibonnaci number without memoization. | |
.data | |
# 0x400 | |
N: .word 9 | |
# 0x404 | |
R: .word 0 | |
.text | |
# PLAN: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
OlderNewer