Skip to content

Instantly share code, notes, and snippets.

View hungify's full-sized avatar
🎯
Stay focused, achieve more

hungify hungify

🎯
Stay focused, achieve more
View GitHub Profile
@nghiepdev
nghiepdev / Dockerfile
Created June 14, 2024 09:20
Dockerfile.next.js.example
# Stage 0
FROM node:20-slim as base
LABEL maintainer="Nghiep <[email protected]>"
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN corepack prepare pnpm@9 --activate
ENV NEXT_TELEMETRY_DISABLED 1
WORKDIR /app
COPY .npmrc package.json pnpm-lock.yaml pnpm-workspace.yaml cache-handler.mjs next.config.mjs ./
@nathanchase
nathanchase / [...].ts
Last active March 7, 2024 02:34
Nuxt 3 Server API catch-all w/ caching, retries, and request/response logging (with total elapsed time)
// Here's my current implementation of a Nuxt 3 server API catch-all with caching, retries, and request/response logging with total elapsed time:
// Place in: /server/api/[...].ts
import LRU from 'lru-cache';
import { getCookie } from 'h3';
const config = useRuntimeConfig();
const cache = new LRU({
max: 100,
@wobsoriano
wobsoriano / proxy.ts
Last active December 22, 2023 02:25
Nuxt 3 http-proxy-middleware
// ~/server/middleware/proxy.ts
import { defineEventHandler } from 'h3'
import { createProxyMiddleware } from 'http-proxy-middleware'; // npm install http-proxy-middleware@beta
const apiProxyMiddleware = createProxyMiddleware({
target: 'https://jsonplaceholder.typicode.com',
changeOrigin: true,
ws: true,
pathRewrite: {
'^/api/todos': '/todos',
@alexreardon
alexreardon / drag-and-drop-notes.md
Last active April 8, 2025 21:00
An explanation of the timing of drag and drop events

Drag and drop

This is a collection of knowledge I have built up regarding browser powered drag and drop functionality

Events

dragstart

  • timing: once as drag is starting
  • event.target: draggable Element