You can run eslint --fix
on the currently open file in VSCode without using the ESLint extension by combining a task and a custom shortcut.
Create a .vscode/tasks.json
file in your project and add the following:
pnpm install -g eslint
import Bun from 'bun' | |
import { createYoga, YogaInitialContext, YogaServerInstance } from 'graphql-yoga' | |
import { makeHandler } from "graphql-ws/lib/use/bun"; | |
import { ExecutionArgs } from "@envelop/types"; | |
import { schema } from './graphql/schema'; | |
interface IUserContext { | |
token?: string; | |
} |
## Git Update Alias | |
You can create a Git alias to easily update your fork by synchronizing it with the original repository (upstream). The alias performs a series of commands to fetch the latest changes from upstream, merge them into your fork, and push the changes to your remote repository. | |
### 1. **Set up the Alias** | |
Run the following command in your terminal to define the `git update` alias: | |
```bash | |
git config --global alias.update '!f() { git fetch upstream && git merge upstream/main && git push origin main; }; f' |
docker pull redis:7.4.2-alpine3.21 | |
docker pull postgres:17.4-alpine3.21 | |
# run | |
docker run --name dev-redis -d -p 6379:6379 redis:7.4.2-alpine3.21 | |
docker run --name dev-postgres -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres postgres:17.4-alpine3.21 | |
docker run --name dev-mail -d -p 1080:1080 -p 1025:1025 marlonb/mailcrab:latest | |
# connect | |
DATABASE_POSTGRES_URL=postgres://postgres:postgres@localhost:5432/postgres |
diskutil list | |
diskutil unmountDisk /dev/disk2 | |
diskutil eraseDisk FAT32 SANDISK /dev/disk2 |
// #1 | |
function logWrapper(fn: Function) { | |
return function (...args: any[]) { | |
console.log(`Calling function with args: ${args}`); | |
return fn(...args); | |
}; | |
} |
import { animate } from 'motion' | |
import type { AnimationPlaybackControls, ValueAnimationOptions } from 'motion/react' | |
import { | |
type VNode, | |
computed, | |
defineComponent, | |
h, | |
mergeProps, | |
reactive, | |
useAttrs, |
-- Based off IETF draft, https://datatracker.ietf.org/doc/draft-peabody-dispatch-new-uuid-format/ | |
create or replace function uuid_generate_v7() | |
returns uuid | |
as $$ | |
begin | |
-- use random v4 uuid as starting point (which has the same variant we need) | |
-- then overlay timestamp | |
-- then set version 7 by flipping the 2 and 1 bit in the version 4 string | |
return encode( |