👨👩👧👦
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add eslint-plugin-react-compiler --dev | |
node -e "const fs = require('fs'); const eslintrcJson = JSON.parse(fs.readFileSync('.eslintrc.json')); eslintrcJson.plugins = eslintrcJson.plugins || []; eslintrcJson.plugins.push('react-compiler'); eslintrcJson.rules = eslintrcJson.rules || {}; eslintrcJson.rules['react-compiler/react-compiler'] = 'error'; fs.writeFileSync('.eslintrc.json', JSON.stringify(eslintrcJson, null, 2));" | |
yarn lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm pkg set resolutions.'@types/react'='npm:types-react@rc' | |
npm pkg set resolutions.'@types/react-dom'='npm:types-react-dom@rc' | |
yarn config set enableImmutableInstalls false | |
yarn up react@rc react-dom@rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference types="react/next" /> | |
import { use as originalUse, useContext } from 'react'; | |
const STATUS = { | |
PENDING: 'pending', | |
REJECTED: 'rejected', | |
FULFILLED: 'fulfilled', | |
} as const; | |
type TState<T> = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'node:fs'; | |
import { asyncForEach, asyncForEachStrict } from '@wojtekmaj/async-array-utils'; | |
import chalk from 'chalk'; | |
import { endOfMonth, formatISO, startOfMonth } from 'date-fns'; | |
const CACHE_DIR = '.cache'; | |
const GITHUB_API_URL = 'https://api.github.com'; | |
const GITHUB_TOKEN = process.env.GITHUB_TOKEN; | |
const DEBUG = process.env.DEBUG === 'true'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample usage: bash ./foreach.sh ./update-dependencies.sh | |
script_dir=$(dirname -- "$( readlink -f -- "$0"; )") | |
echo "Running script $1 for each repository" | |
# Find all Git repositories, skipping node_modules directories | |
find . -maxdepth 4 -name ".git" -print0 | while read -d $'\0' repo; do | |
echo "Processing ${repo%/.git}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find | |
import\s(([^;]|\n)*)\sfrom\s(['"])(\.{1,2}\/.*)(?<!\.js)(?<!\.(css|pdf|png|jpg|jsx|mjs|mp3|mp4|svg|ttf))(?<!\.(avif|json|webm|webp|woff))(?<!\.woff2)(['"]); | |
# Replace with | |
import $1 from $3$4.js$7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ensure we're working on the latest version of the main branch | |
git switch main | |
git fetch | |
git pull | |
# Create a new branch | |
git switch -c vitest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ensure we're working on the latest version of the main branch | |
git switch main | |
git fetch | |
git pull | |
# Create a new branch | |
git switch -c vite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Define function | |
update_dependencies() { | |
rm -rf yarn.lock | |
touch yarn.lock | |
yarn | |
yarn dedupe | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
current_year=$(date +%Y) | |
# Find all Git repositories, skipping node_modules directories | |
find . -type d -name .git -not -path '*/node_modules/*' -print0 | while read -d $'\0' repo; do | |
# Go to the repository directory | |
cd "${repo%/.git}" | |
# Check the year of the last commit |
NewerOlder