Skip to content

Instantly share code, notes, and snippets.

View NickFoden's full-sized avatar
🐯
I'm here live, i'm not a cat.

Nick Foden NickFoden

🐯
I'm here live, i'm not a cat.
View GitHub Profile
@kentcdodds
kentcdodds / session.server.ts
Created November 18, 2021 21:04
Authentication in Remix applications
import * as bcrypt from "bcrypt";
import { createCookieSessionStorage, redirect } from "remix";
import { db } from "./db.server";
export type LoginForm = {
username: string;
password: string;
};
@gaearon
gaearon / uselayouteffect-ssr.md
Last active May 16, 2024 14:13
useLayoutEffect and server rendering

If you use server rendering, keep in mind that neither useLayoutEffect nor useEffect can run until the JavaScript is downloaded.

You might see a warning if you try to useLayoutEffect on the server. Here's two common ways to fix it.

Option 1: Convert to useEffect

If this effect isn't important for first render (i.e. if the UI still looks valid before it runs), then useEffect instead.

function MyComponent() {
@alanbsmith
alanbsmith / PULL_REQUEST_TEMPLATE.md
Last active April 14, 2020 21:17
A template for helpful pull request documentation

Issue

#IssueNumber

Overview

Give a brief description of what this PR does.

Where Should the Reviewer Start?

e.g. /src/components/SomeComponent.js

Testing Manually

How we incorporate next and cloudfront (2018-04-21)

Feel free to contact me at robert.balicki@gmail.com or tweet at me @statisticsftw

This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!

It assumes some knowledge of AWS.

Goals