- Install dependencies
npm i -D inquirer chalk exec-sh ts-node
- Add this structure to your package.json and include all file paths that have a version key that you want to modify.
This assumes version key in the first level of the jsons.
| // Internal type correctness is not the goal. The goal is good DX building out queriesx | |
| export class QueryBuilder { | |
| private collection: CollectionReference<DocumentData, DocumentData> | |
| constructor(path: string) { | |
| this.collection = collection(firestore, path) | |
| } | |
| private where: QueryFieldFilterConstraint[] = [] | |
| filter(fieldPath: string | FieldPath, opStr: WhereFilterOp, value: unknown) { | |
| this.where.push(where(fieldPath, opStr, value)) |
| type Error = { type: 'error'; error: any; }; | |
| type Success<R> = { type: 'success'; data: R; }; | |
| /** | |
| * No more try catch blocks | |
| * | |
| * Inspired by {@link [Golang's error handling](https://gabrieltanner.org/blog/golang-error-handling-definitive-guide)} | |
| * using typescript's {@link [narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html)} | |
| * to provide a type-safe DX. | |
| * |
| function onChange(data, callback) { | |
| return new Proxy(data, { | |
| set(target, prop, value) { | |
| target[prop] = value; | |
| callback(target, value); | |
| return true; | |
| } | |
| }); | |
| } |
| { | |
| "$schema": "https://solid-resume.vercel.app/schema.json", | |
| "meta": { | |
| "canonical": "https://gist.github.com/metruzanca/751361e5ba58ad06f361ebd430ae6e10", | |
| "version": "v1.0.0", | |
| "lastModified": "2025-03-06T14:56:49.946Z", | |
| "theme": "actual" | |
| }, | |
| "basics": { | |
| "name": "Sam Zanca", |
| const isPromise = <T = any>(promise: any): promise is Promise<T> => promise.constructor.name === 'Promise' | |
| type Error = { | |
| type: 'error'; | |
| error: any; | |
| }; | |
| type Success<R> = { | |
| type: 'success'; |
| const fs = require('fs'); | |
| const meta = require('./config.json') | |
| // Cannot use classes for some reason. Using prototypal inheritance | |
| module.exports = function Fs({tp, cwd = process.cwd()}) { | |
| if(!tp) return 'tp is required for Fs' | |
| this.tp = tp | |
| this.vaultRoot = cwd + meta.vault.path | |
| /** |
| FROM python:3.8-slim | |
| # Install dependencies: ffmpeg & git | |
| RUN apt-get -y update; \ | |
| apt-get -y upgrade; \ | |
| apt-get install -y ffmpeg; \ | |
| apt-get install -y git | |
| # Manual install ytmdl (https://github.com/deepjyoti30/ytmdl) | |
| RUN pip install setuptools; \ |