Skip to content

Instantly share code, notes, and snippets.

@steipete
steipete / committer
Created October 18, 2025 17:26
Simple commit script so agents don't f*ck up. Disallow other git commands. (except status/diff)
#!/usr/bin/env bash
set -euo pipefail
usage() {
printf 'Usage: %s "commit message" "file" ["file" ...]\n' "$(basename "$0")" >&2
exit 2
}
if [ "$#" -lt 2 ]; then
@mansarip
mansarip / info.md
Last active January 2, 2025 12:04
How to use PDFKit with Hono + Bun

How to use PDFKit with Hono + Bun

Full example

import { Hono } from "hono";
import PDFDocument from "pdfkit";

const app = new Hono();
import cv2
import numpy as np
from matplotlib import pyplot as plt
left_image_address = '/home/deveshdatwani/Desktop/left.jpg'
right_image_address = '/home/deveshdatwani/Desktop/right.jpg'
left_image = cv2.imread(left_image_address, cv2.IMREAD_GRAYSCALE)
right_image = cv2.imread(right_image_address, cv2.IMREAD_GRAYSCALE)
@nderscore
nderscore / TamaguiSolitoTextLink.tsx
Last active October 16, 2024 17:26
Example Tamagui Solito Text Link
@nandorojo
nandorojo / DraggableScrollView.tsx
Last active November 19, 2025 16:11
Make a horizontal `ScrollView` draggable with a mouse (`react-native-web`)
import React, { ComponentProps } from 'react'
import { ScrollView } from 'react-native'
import { useDraggableScroll } from './use-draggable-scroll'
export const DraggableScrollView = React.forwardRef<
ScrollView,
ComponentProps<typeof ScrollView>
>(function DraggableScrollView(props, ref) {
const { refs } = useDraggableScroll<ScrollView>({
outerRef: ref,
@m-radzikowski
m-radzikowski / script-template.sh
Last active October 9, 2025 00:41
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@kez
kez / slugify.sql
Created May 13, 2019 14:50 — forked from ianks/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@pramsey
pramsey / 0-spatial-sql-postgis.md
Last active June 3, 2025 02:08
Spatial SQL and PostGIS
@katopz
katopz / setup-zeromq.sh
Last active April 12, 2025 00:09 — forked from cdjhlee/zeromq_install.sh
Setup zeromq in Ubuntu 16.04
#!/usr/bin/bash
# Download zeromq
# Ref http://zeromq.org/intro:get-the-software
wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz
# Unpack tarball package
tar xvzf zeromq-4.2.2.tar.gz
# Install dependency
@schmich
schmich / npm-prerelease.md
Last active June 26, 2024 13:20
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package