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
.unreset { | |
a { | |
@apply text-blue-700 underline; | |
} | |
p { | |
@apply my-4; | |
} | |
blockquote, | |
figure { |
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
// From the comment from @SukkaW here: | |
// https://github.com/vercel/next.js/pull/60616#issuecomment-1902608289 | |
// Here is what I am doing currently, to authenticate and authorize | |
// RSC pages and components (like a button or a tooltip) | |
function GuardedComponent() { | |
const user = useUser(); | |
// guard() will throw a `NoPermissionError` when the user doesn't have the permission | |
guard(user, permissionList); |
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
// https://twitter.com/karlhorky/status/1720368118193651903 | |
/** @type {import('@typescript-eslint/utils').TSESLint.Linter.Config} */ | |
const config = { | |
'no-restricted-syntax': [ | |
'warn', | |
{ | |
selector: | |
'CallExpression[callee .object.name=Promise][callee .property.name=all] > ArrayExpression > AwaitExpression', | |
message: 'Avoid await within array passed to Promise.all() to avoid waterfalls', |
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
const hosts = new Set(["Wes", "Scott", "Snickers"]); | |
const team = new Set(["Wes", "Scott", "Kaitlin", "Ben"]); | |
const fans = new Set(["Paige", "Nick", 1]); | |
// Difference between two sets | |
console.log(team.difference(hosts)); // Set { 'Kaitlin', 'Ben' } | |
// Overlap between two sets | |
console.log(team.intersection(hosts)); // Set { 'Wes', 'Scott' } |
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
const CH_BRACE_L = 0x7b as const; | |
const CH_BRACE_R = 0x7d as const; | |
const CH_SQUARE_L = 0x5b as const; | |
const CH_SQUARE_R = 0x5d as const; | |
const CH_QUOTE_D = 0x22 as const; | |
const CH_ESCAPE = 0x5c as const; | |
const CH_COMMA = 0x2c as const; | |
const CH_COLON = 0x3a as const; | |
const CH_DOT = 0x2e as const; | |
const CH_MINUS = 0x2d as const; |
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 { AwsClient } from "aws4fetch"; | |
import { deflate } from "pako"; | |
const R2_ACCOUNT_ID = "SOMETHING" | |
const R2_ACCESS_KEY_ID = "SOMETHING" | |
const R2_SECRET_ACCESS_KEY ="SOMETHING" | |
const R2_BUCKET = "SOMETHING" | |
const R2_URL = `https://${R2_BUCKET}.${R2_ACCOUNT_ID}.r2.cloudflarestorage.com`; | |
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
2023-04-03T07:53:27.8474256Z Requested labels: ubuntu-latest | |
2023-04-03T07:53:27.8474294Z Job defined at: upleveled/next-js-example-winter-2023-vienna-austria/.github/workflows/test-playwright-and-deploy-to-fly-io.yml@refs/heads/main | |
2023-04-03T07:53:27.8474316Z Waiting for a runner to pick up this job... | |
2023-04-03T07:53:28.1009892Z Job is waiting for a hosted runner to come online. | |
2023-04-03T07:53:30.6303409Z Job is about to start running on the hosted runner: GitHub Actions 2 (hosted) | |
2023-04-03T07:53:32.8886204Z Current runner version: '2.303.0' | |
2023-04-03T07:53:32.8913724Z ##[group]Operating System | |
2023-04-03T07:53:32.8914198Z Ubuntu | |
2023-04-03T07:53:32.8914499Z 22.04.2 | |
2023-04-03T07:53:32.8914804Z LTS |
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 useScrollRestoration from "utils/hooks/useScrollRestoration"; | |
const App = ({ Component, pageProps, router }) => { | |
useScrollRestoration(router); | |
return <Component {...pageProps} />; | |
}; | |
export default App; |
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
# https://stackoverflow.com/a/33548037/1268612 | |
git fetch --prune && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done |