Skip to content

Instantly share code, notes, and snippets.

View rxtsel's full-sized avatar
👾
127.0.0.1

Cristhian Melo rxtsel

👾
127.0.0.1
View GitHub Profile
@perfectbase
perfectbase / await.tsx
Last active April 27, 2025 14:24
Await component for Next.js
import { Fragment, Suspense, type ReactNode } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
type AwaitProps<T> =
| {
promise: Promise<T>;
children: (data: T) => ReactNode;
fallback?: ReactNode;
errorComponent?: ReactNode | null;
}
@Klerith
Klerith / Dockerfile
Last active May 7, 2025 16:06
Preparar imagen de Docker - Node App
# Install dependencies only when needed
FROM node:18-alpine3.15 AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
# Build the app with cache dependencies
FROM node:18-alpine3.15 AS builder
@mrwweb
mrwweb / reset-rems
Created May 22, 2013 13:22
"Sanity-ize" REMs by setting them to 10px-baseline aka "Tiny Happy Pixels Dancing."
/* this is the "root" in "root em." */
html {
font-size: 62.5%; /* Now 10px = 1rem! */
}
body {
font-size: 16px; /* px fallback */
font-size: 1.6rem; /* default font-size for document */
line-height: 1.5; /* a nice line-height */
}