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 }
}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 }
}esbuild src/cli.ts --bundle --platform=node --target=node18 --outfile=dist/bundle.jsGiven 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:
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:/dataYou could use this code to, for example, validate fields from a package.json file for use in a Node.js CLI application.
It gives you a packageInfo object that has some useful fields that you could use (in a help or usage message, for example):
packageInfo.version, so that you can display the CLI versionpackageInfo.bin, so that you can display the name of the CLI commandpackageInfo.repository, so that you can display a URL to the repo for the CLIMake sure your tsconfig.json includes "resolveJsonModule": true.
Include the code below in any bash script!
This is a good way to start a bash script:
#!/usr/bin/env bash
set -eou pipefailThese are some useful generic reusable bash functions.
Issue Description
After upgrading my MacBook Air M1 to macOS Sonoma 14.0 (not sure if it is related to this issue),
I noticed that I often cannot click anything inside a webpage in Chrome, even though I can scroll the page.
Also, sometimes the navigation buttons don't work either.
Resolution Steps
It appears that this fix may have resolved the issue. The inspiration for this fix came from the following Apple community discussion thread:
Watch the full Y Combinator talk on YouTube from Aug 29, 2018 here: https://youtu.be/0lJKucu6HJc
Replace <FirstName>, <LastName>, and <Email> with your information.
mkdir ./cli/ && cd ./cli/
go install github.com/spf13/cobra-cli@latest
cobra-cli init --author "<FirstName> <LastName> <Email>" --license MIT --viper
go mod tidy