Skip to content

Instantly share code, notes, and snippets.

View rphlmr's full-sized avatar
Making things with Remix Run

Raphaël Moreau rphlmr

Making things with Remix Run
View GitHub Profile
@rphlmr
rphlmr / idea.vmoptions
Created December 1, 2020 10:06 — forked from ScriptedAlchemy/idea.vmoptions
improved perf vmoptions
-Xms1024m
-Xmx3072m
-Xss64m
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
-XX:NewRatio=2
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=250
-XX:NewSize=512m
@rphlmr
rphlmr / idea.propertie
Created December 1, 2020 10:06 — forked from ScriptedAlchemy/idea.propertie
custom IntelliJ IDEA properties
# custom IntelliJ IDEA properties
editor.zero.latency.typing=true
idea.max.intellisense.filesize=3500
idea.cycle.buffer.size=2048
@rphlmr
rphlmr / nvmlink
Created May 30, 2021 16:06 — forked from MeLlamoPablo/nvmlink
Creates a symlink to /usr/bin/node after using nvm
@rphlmr
rphlmr / settings.json
Created July 10, 2022 10:14
Custom material palenight theme with better contrast
"workbench.colorTheme": "Material Theme Palenight High Contrast",
"workbench.colorCustomizations": {
"[Material Theme*]": {
"editor.background": "#1A1E2C",
"banner.background": "#1A1E2C",
"breadcrumb.background": "#1A1E2C",
"tab.inactiveBackground": "#1A1E2C",
"tab.activeBackground": "#1A1E2C",
"tab.activeForeground": "#cccccc",
"editorSuggestWidget.background": "#1A1E2C",
@rphlmr
rphlmr / Remix Run Firefox Warning: Prop `disabled` did not match. Server: "null" Client: "true" .md
Created August 11, 2022 13:03
Remix Run Firefox Warning: Prop `disabled` did not match. Server: "null" Client: "true"

When you have a Form (Remix) whith a <button type="submit" disabled={disabled}>, Firefox results in hydratation error Prop 'disabled' did not match. Server: "null" Client: "true".

To solve this issue, just add autoComplete="off" on your Form

Doesn't work with Firefox (103.0.2)

const [isDisabled, setIsDisabled] = useState(false);
@rphlmr
rphlmr / ink-confirm-input.tsx
Last active August 21, 2022 07:28
Ink Image and Confirm input implementation
/**
* Credit to https://github.com/kevva/ink-confirm-input
* This is a fork of the original component that is not maintained anymore
*/
import React, { useCallback } from "react";
import { UncontrolledTextInput } from "ink-text-input";
import yn from "yn";
type ConfirmInputProps = React.ComponentProps<typeof UncontrolledTextInput> & {
@rphlmr
rphlmr / [component]{{parseName name}}.tsx.hbs
Last active September 22, 2022 17:47
Generate React Components with Plop
export function {{pascalCase (parseName name)}}() {
return <></>
}
@rphlmr
rphlmr / example.tsx
Last active September 26, 2022 15:21
Remix Route Modal with Tailwind and HeadlessUI
import { HashtagIcon, XMarkIcon } from "@heroicons/react/24/outline";
import type { LoaderArgs, MetaFunction } from "@remix-run/node";
import { metaTitle } from "@helpers";
import { useGetRootPath } from "@hooks";
import {
IconLink,
Modal,
@rphlmr
rphlmr / zod-helper.ts
Created October 16, 2022 20:38
Zod implements a TypeScript model
// Thanks https://github.com/colinhacks/zod/issues/372#issuecomment-830094773
type Implements<Model> = {
[key in keyof Model]-?: undefined extends Model[key]
? null extends Model[key]
? z.ZodNullableType<z.ZodOptionalType<z.ZodType<Model[key]>>>
: z.ZodOptionalType<z.ZodType<Model[key]>>
: null extends Model[key]
? z.ZodNullableType<z.ZodType<Model[key]>>
: z.ZodType<Model[key]>;
@rphlmr
rphlmr / route.tsx
Last active July 24, 2024 13:02
Remix Supabase Upload
// if you don't plan to upload only images :
/*
async function convertToFile(data: AsyncIterable<Uint8Array>) {
const chunks = [];
for await (const chunk of data) {
chunks.push(chunk);
}
return chunks;
}