Skip to content

Instantly share code, notes, and snippets.

@catalinmiron
catalinmiron / README.md
Created April 16, 2024 20:36
Expo app.json Apple Privacy Manifest

About

The privacy details that you may need to add for Apple Privacy Manifest.

This config plugin it's already available from expo >=50.0.17 (Part of this PR by aleqsio)

Tip

Read more about Privacy Manifest File from Apple docs

@lithdew
lithdew / Dockerfile
Created April 4, 2024 20:31
Dockerfile for deploying a Next.js standalone bundle on Fly.io with Bun.
# syntax = docker/dockerfile:1
# Adjust BUN_VERSION as desired
ARG BUN_VERSION=1.1.1
FROM oven/bun:${BUN_VERSION}-slim as base
LABEL fly_launch_runtime="Next.js"
# Next.js app lives here
WORKDIR /app
@AndrewIngram
AndrewIngram / CurrentTime.tsx
Created November 21, 2023 00:04
Current time in React without hydration errors
import { Suspense } from "react";
import CurrentTimeClient from "./CurrentTimeClient";
export default function CurrentTime() {
const locale = "en-GB";
const dateConfig = {
hour: "numeric",
minute: "numeric",
second: "numeric",
import * as React from 'react';
const useIsFirstRender = (): boolean => {
const isFirst = React.useRef(true);
if (isFirst.current) {
isFirst.current = false;
return true;
} else {
"use client";
import { cache, unstable_postpone } from "react";
import { preload } from "react-dom";
const loadImage = cache((src: string) => {
return new Promise<void>((resolve, reject) => {
const img = new Image();
img.src = src;
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;
@markerikson
markerikson / rtk-esm-ts-notes-2023-02-27.md
Last active September 3, 2023 00:33
RTK ESM/TS Config meeting notes - 2023-02-27/28

RTK ESM/TS Discussion

Attendees:

  • Nathan Bierema
  • Mateusz Burzynski
  • Mark Erikson

Notes

  • Mateusz: what do you want besides "ship widely compat code?" What preferences?
@AndrewIngram
AndrewIngram / R2_storage.ts
Last active March 20, 2024 11:05
Read/write from Cloudflare R2 in a Vercel edge function w/default
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`;
@RobertAKARobin
RobertAKARobin / safari.md
Last active January 5, 2024 05:41
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem