Here are some configuration settings for setting up Redis.
This should go in your docker-compose.yaml
:
redis:
image: redis/redis-stack-server:7.2.0-v2
restart: always
volumes:
- redis-data:/data
Here are some configuration settings for setting up Redis.
This should go in your docker-compose.yaml
:
redis:
image: redis/redis-stack-server:7.2.0-v2
restart: always
volumes:
- redis-data:/data
Given a date field and a sprint size (10 days), this formula calculates the number of sprints remaining (integer) until the end of the year.
This formula can be used in a Notion formula field.
floor(max((dateBetween(dateAdd(dateAdd(start(prop("Date")), 11 - month(start(prop("Date"))), "months"), 31 - date(start(prop("Date"))), "days"), start(prop("Date")), "days") - dateBetween(end(prop("Date")), start(prop("Date")), "days")), 0) / 10)
Here's an explanation of what is going on:
esbuild src/cli.ts --bundle --platform=node --target=node18 --outfile=dist/bundle.js
Utility function
import { transform, Options } from '@swc/core'
export async function compile (params: { source: string, options?: Options }) {
const { code, map } = await transform(params.source, params.options)
return { code, map }
}
import { join, basename, extname } from 'path' | |
import { readdir } from 'fs-extra' | |
/** | |
* Lists all files in the specified `directory`, without any external libraries. | |
* | |
* If `directory` is not specified, `process.cwd()` is used. | |
* | |
* Set `includeDirectories` to `true` to also include directory names in the output. | |
* |
There are countless guides online for setting up a TypeScript monorepo.
Most rely on external tools like Lerna, Yarn, Turborepo, Yalc, or something else.
Here's a simple, zero-opinion way to get a TypeScript monorepo going.
First, make a structure like this:
root/
VSCode DevContainers are way better than installing tools locally and coding on your machine; it prevents tool clutter, and ensures your project is portable across your team.
For Node.js / JavaScript / TypeScript development, just create a .devcontainer/devcontainer.json
file at the top-level
in your workspace with the following contents:
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:18-bullseye"
This is a simple VSCode launch configuration for debugging TypeScript code that will work with most TypeScript projects.
It allows you to easily debug your project using the awesome debugging experience in VSCode.
It works perfectly for library and CLI projects that are written in TypeScript and are targeting CommonJS.
.vscode/
folder in your workspace at the top-level, if you don't have that folder already.There's a bug on the MacBook Air (M1, 2020) where the audio process crashes or something, and no videos or audio will play.
Here's how to restart the audio process when that happens:
sudo pkill coreaudiod
# or, if the audio process is not responding at all
sudo pkill -9 coreaudiod
Usage
const hashRing = createHashRing({
clients: [
{ address: 'localhost:5001' },
{ address: 'localhost:5002' },
{ address: 'localhost:5003' }
]
})