Skip to content

Instantly share code, notes, and snippets.

View yehezkieldio's full-sized avatar

Yehezkiel Dio Sinolungan yehezkieldio

View GitHub Profile
pkgname=cloudflare-warp-nox-bin
pkgver=2025.6.1335
pkgrel=1
pkgdesc="Cloudflare Warp Client (for servers without graphical environment) — CLI binaries renamed to avoid conflicts"
arch=('x86_64')
url="https://1.1.1.1"
license=('unknown')
depends=('dbus' 'gcc-libs' 'glibc' 'nftables' 'nspr' 'nss')
# IMPORTANT: do NOT 'provide' warp-cli/warp-svc to avoid virtual-name conflicts
provides=('cloudflare-warp-nox-bin')
#!/bin/bash
readonly HASH="%C(always,yellow)%h%C(always,reset)"
readonly RELATIVE_TIME="%C(always,green)%ar%C(always,reset)"
readonly AUTHOR="%C(always,bold blue)%an%C(always,reset)"
readonly REFS="%C(always,red)%d%C(always,reset)"
readonly SUBJECT="%s"
readonly FORMAT="$HASH $RELATIVE_TIME{$AUTHOR{$REFS $SUBJECT"
readonly FORMAT_WITHOUT_AUTHOR="{$REFS $SUBJECT"
#!/bin/bash
GRAAL_FLAGS="-XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler -XX:+UseG1GC"
MEMORY_FLAGS="-Xms4G -Xmx8G -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32m"
PERFORMANCE_FLAGS="-XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+UseFastUnorderedTimeStamps"
COMPILER_FLAGS="-XX:+TieredCompilation -XX:TieredStopAtLevel=4 -XX:CompileThreshold=1000"
SYSTEM_FLAGS="-Dsun.java2d.opengl=true -Djava.awt.headless=false -Dfile.encoding=UTF-8"
LATENCY_FLAGS="-XX:+UseTransparentHugePages -XX:+UseLargePages -XX:LargePageSizeInBytes=2m"
JAVA_OPTS="$GRAAL_FLAGS $MEMORY_FLAGS $PERFORMANCE_FLAGS $COMPILER_FLAGS $SYSTEM_FLAGS $LATENCY_FLAGS --enable-native-access=ALL-UNNAMED"
import { type Command, InvalidArgumentError } from "commander";
import z from "zod";
export function registerOptions<T extends z.ZodRawShape>(cmd: Command, schema: z.ZodObject<T>): void {
const shape = schema.shape;
const toKebab = (s: string) =>
s
.replace(/GitHub/g, "Github") // Handle "GitHub" as a special case first
.replace(/([a-z])([A-Z])/g, "$1-$2") // Insert dash between lowercase and uppercase
`$fn` where {
$fn <: `try { $body } catch($err) { $catchBody }`,
register_diagnostic(
span = $fn,
message = "Try-catch blocks are disallowed. Consult project guidelines for the expected error handling approach."
)
}
ARG POSTGRESQL_MAJOR=17
ARG PGX_ULID_RELEASE=0.2.0
ARG TARGETARCH=amd64
FROM ghcr.io/craigpastro/pg_uuidv7:main AS base
ARG POSTGRESQL_MAJOR
ARG PGX_ULID_RELEASE
ARG TARGETARCH
RUN case "${TARGETARCH}" in amd64|arm64) : ;; *) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; esac

Key Takeaway: JS/TS is ALWAYS Pass-by-Value. The "value" being passed is either a primitive directly, or a reference (a pointer) to an object.


1. Primitives (Stack-like Behavior, Value Copied)

  • Types: number, string, boolean, bigint, symbol, null, undefined
  • What's Passed: An exact copy of the value itself.
  • Behavior:
  • When you pass a primitive to a function, the function gets its own, independent copy.
"use client";
import React from "react";
import { Button } from "#/components/ui/button";
import { Checkbox } from "#/components/ui/checkbox";
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
@yehezkieldio
yehezkieldio / STARS.md
Last active June 29, 2025 21:31
A list of almost all of my GitHub stars
@yehezkieldio
yehezkieldio / async-handler.js
Created June 24, 2025 02:19
Use a Universal Async Error Handler
const asyncHandler = fn => (req, res, next) => {
Promise.resolve(fn(req, res, next)).catch(next);
};
app.get('/data', asyncHandler(async (req, res) => {
let data = await fetchData();
res.send(data);
}));