Skip to content

Instantly share code, notes, and snippets.

View kendallroth's full-sized avatar
🍁

Kendall Roth kendallroth

🍁
View GitHub Profile
@kendallroth
kendallroth / README.md
Last active July 22, 2024 16:22
CS2 Modding: JS deobfuscation

CS2 Modding: JS deobfuscation

For anyone else working on understanding some of the JS helpers for the Colossal Order UI package, I spent some time deobfuscating a couple functions/classes. Please note there certainly be mistakes and there is some omitted code; however, overall the gist is present.

@kendallroth
kendallroth / pocketbase_v23_data_migration_guide.md
Created May 13, 2025 21:23
Guide for migrating data in Pocketbase v23 upgrade

Upgrading to v23

Upgrading to Pocketbase v23 was a large undertaking due to the amount of fundamental changes to extending as a framework. The library contains several excellent resources, including the GitHub Release and Pocketbase Upgrade Guide, that help with the upgrade. However, they do not explain how to handle upgrading deployed/production instances, which is a bit more tricky depending on the server host. This guide deals with upgrading a Pocketbase application deployed on Pockethost, an excellent and affordable hosting service for Pocketbase apps.

Official Upgrade Guide

The Pocketbase Upgrade Guide provides an excellent guide to the major breaking changes. However, there were a few assorted changes not explicitly documented (and there may be others still).

Email templates no longer have ACTION_URL

Email templa

@kendallroth
kendallroth / repository.util.ts
Last active July 10, 2025 21:25
Update TypeORM entity fields from a NestJS DTO object
/**
* Set defined/scalar entity fields from a DTO (only using fields existing on entity)
*
* NOTE: Mutates original value!
*
* NOTE: Skips all non-scalar fields and `undefined` DTO values, which would other wise cause unexpected
* data loss for non-specified or partially provided relation values. However, non-scalar fields
* can be permitted with `allowNonScalarKeys` if specifically handled/provided.
*
* @param options.allowNonScalarKeys - Allows non-scalar keys to be assigned (ie. arrays, objects, etc)
@kendallroth
kendallroth / README.md
Created July 22, 2025 19:51
Postgres Table Sizes

Postgres Table Sizes

Calculating Postgres table sizes is a bit complicated, due to the variety of data sizes available.

  • Table data
    • main - main data fork of relation
    • fsm - Free Space Map for relation
    • vm - Visibility Map for relation
    • init - initialization fork (if any) for relation
  • TOAST data