- 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.
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": "Samuele 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; \ |
{ | |
"Gatsby Function Component": { | |
"prefix": "gfc", | |
"body": [ | |
"import React from \"react\"", | |
"import { useStaticQuery, graphql } from \"gatsby\"", | |
"", | |
"// import {} from './styles'", | |
"", | |
"interface Props {", |