This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getOptionalRequestContext } from "@cloudflare/next-on-pages"; | |
import { workAsyncStorage } from "next/dist/server/app-render/work-async-storage.external"; | |
export type AfterTask<T = unknown> = Promise<T> | AfterCallback<T>; | |
export type AfterCallback<T = unknown> = () => T | Promise<T>; | |
export function waitUntil(promise: Promise<unknown>) { | |
const cloudflareCtx = getOptionalRequestContext(); | |
if (!cloudflareCtx) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Alternatives: postgres:15-alpine | |
ARG BASE_IMAGE=postgis/postgis:15-3.4-alpine | |
## Custom Alpine Postgres docker file with custom extensions | |
FROM ${BASE_IMAGE} as builder | |
# Install required dependencies | |
RUN apk --no-cache add \ | |
python3 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { sql } from "drizzle-orm"; | |
import { customType, CustomTypeValues } from "drizzle-orm/pg-core"; | |
/** | |
* Experimental custom type for PostGIS geometry, only supports reads | |
*/ | |
export const geometry = < | |
TType extends GeoJSON.Geometry["type"] = GeoJSON.Geometry["type"], | |
T extends CustomTypeValues = CustomTypeValues, | |
>( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type GeometryTypes = { | |
Point: GeoJSON.Point; | |
LineString: GeoJSON.LineString; | |
Polygon: GeoJSON.Polygon; | |
MultiPoint: GeoJSON.MultiPoint; | |
MultiLineString: GeoJSON.MultiLineString; | |
MultiPolygon: GeoJSON.MultiPolygon; | |
GeometryCollection: GeoJSON.GeometryCollection; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Summarize Turborepo Output" | |
description: "Summarize Turborepo output for GitHub Actions" | |
runs: | |
using: "composite" | |
steps: | |
- shell: bash | |
name: "Summarize Turborepo Output" | |
run: | | |
latest_json=$(ls -t .turbo/runs/*.json | head -1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S pnpm tsx | |
import crypto from "crypto"; | |
import fs from "fs"; | |
import path from "path"; | |
import { | |
createFingerprintAsync, | |
diffFingerprintChangesAsync, | |
} from "@expo/fingerprint"; | |
const projectRoot = process.cwd(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import NextLink, { LinkProps } from "next/link"; | |
/** | |
* Higher Order Component to turn any component with a href into a component that supports `next/link`. | |
* | |
* Pass the component props like this: | |
* @example const Button = withNextLink<ButtonProps>(MuiButton); | |
* TODO: Look into forwarding refs. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Highly performant NanoID implementation in PL/pgSQL. | |
-- | |
-- NOTE: This is a concept implementation, hasn't been battle tested. | |
-- | |
-- Version: 0.1 | |
-- Inspired by https://github.com/Jakeii/nanoid-postgres | |
-- @author github.com/ItsWendell | |
CREATE OR REPLACE FUNCTION gen_nanoid(size int DEFAULT 21) | |
RETURNS text AS $$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { merge } from "lodash"; | |
import { request } from "https"; | |
import { v4 as uuidv4 } from "uuid"; | |
export const name = "analytics-lamdba"; | |
export const version = "0.1.2"; | |
export type SegmentMessageTypes = | |
| "identify" | |
| "group" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ServerResponse } from "http"; | |
interface CacheControlConfig { | |
sMaxAge?: number; | |
maxAge?: number; | |
staleWhileRevalidate?: boolean | number; | |
publicCache?: boolean; | |
privateCache?: boolean; | |
immutable?: boolean; | |
noCache?: boolean; |
NewerOlder