Skip to content

Instantly share code, notes, and snippets.

View blefnk's full-sized avatar
🏃‍♂️
audentes fortuna iuvat

Nazar Kornienko blefnk

🏃‍♂️
audentes fortuna iuvat
View GitHub Profile
@blefnk
blefnk / Cargo.toml
Last active August 24, 2025 23:57
Big F'n Numbers (Rust Experiment)
# https://doc.rust-lang.org/cargo/reference/manifest.html
[package]
name = "bigf"
version = "0.1.0"
edition = "2024"
description = "Big number calculator"
[dependencies]
num-bigint = "0.4.6"
@blefnk
blefnk / setup-nextjs.md
Last active March 22, 2025 05:47
Next.js 15 Project Bootstrapper with Bun, Drizzle ORM, and shadcn/ui (Windows, MacOS, Linux)

Next.js 15 Project Bootstrapper with Bun, Drizzle ORM, and shadcn/ui (Windows, MacOS, Linux)

A fullstack setup script for bootstrapping a modern fullstack Next.js application using Bun. This script automates the entire initialization process with production-ready configurations and best practices.

Features

  • Next.js with App Router and TypeScript
  • Bun package manager and script runner for improved performance
  • Tailwind CSS with automatic migrator from v3 to v4
  • Dual linting/formatting with ESLint and Biome
  • Drizzle ORM configured for PostgreSQL databases (optional)
@t3dotgg
t3dotgg / try-catch.ts
Last active August 24, 2025 12:51
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@sindresorhus
sindresorhus / esm-package.md
Last active August 25, 2025 12:05
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.