Skip to content

Instantly share code, notes, and snippets.

/**
* ✅ Simple email validator
*
* - Based on RFC 5322 (simplified).
* - Validates basic structure: local@domain.
* - Allows most real-world email addresses.
*
* @see https://www.rfc-editor.org/rfc/rfc5322
*/
export function isValidEmail(email: string): boolean {
@jaimezambranachacon
jaimezambranachacon / gist:5f652897c3cdad8d14c7a5cd53434d93
Last active April 23, 2025 00:53
API in routes from laravel 12
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\UserController;
Route::get('/user', function (Request $request) {
return $request->user();
@vec715
vec715 / Setup Podman on Chrome OS Flex and Crostini.md
Last active April 23, 2025 00:53
Setup Podman on Chrome OS Flex and Crostini

Actual versions for this guide:

  • Operating System: Debian GNU/Linux 12 (bookworm)
  • Kernel: Linux 6.1.64-09049-g010fe86d9eae
  • Architecture: x86-64
  • Podman: v1.7.1

Installation

1. Install Podman:

sudo apt install podman
import { ServerResponse, type IncomingMessage } from "node:http";
import { Http2ServerRequest, Http2ServerResponse } from "node:http2";
import { isArrayBufferView } from "node:util/types";
const INTERNAL_BODY = Symbol("internal_body");
const GlobalResponse = Response;
globalThis.Response = class Response extends GlobalResponse {
[INTERNAL_BODY]: BodyInit | null | undefined = null;
@FelixHuang9977
FelixHuang9977 / builder.sh
Created April 22, 2025 21:48 — forked from ryancdotorg/builder.sh
Script to statically cross compile various useful binaries (dropbear, socat, rsync, rpcapd, tcpdump, openssl, zstd) using musl-libc via musl.cc toolchains,
#!/bin/bash
# From https://gist.github.com/ryancdotorg/84275935f0b82578d8c222e2e915fc78
# built binaries at https://ryanc-musl-bins.s3.amazonaws.com/SHA256SUMS.html
set -eo pipefail
set -x
export BUILD_SCRIPT_DATE="$(date -r "$0" -Iseconds)"
PV_VERSION=1.8.5
@manfe
manfe / dump.sql
Created October 29, 2012 19:27
Postgres - Estados e Cidades Brasileiras, dados extraídos do site do IBGE - SQL
-- Os dados contidos nesse arquivo foram extraídos do site: http://ibge.gov.br/cidadesat utilizando ruby, nokogiri e expressões regulares.
-- Autor: Mauricio Natanael Ferreira
-- Github: https://github.com/manfe
-- Twitter: @manfe01
-- Email: contato [at] ferreiramauricio [dot] com
-- ***********************************************************************************************************************************************
-- id ...
@aizenbit
aizenbit / deb-package.md
Last active April 23, 2025 00:48
Собрать deb-пакет из бинарника

Сборка deb-пакета из бинарника

В некой временной директории (например, ~/tmp) создаём директорию DEBIAN, а в ней - файл control с содержимым вроде такого:

> Package: имя-пакета
Version: версия пакета, скажем 1.0 или 2.7.9. Должна начинаться с цифры
Architecture: архитектура(i386, amd64, all...)
Maintainer: сопровождающий пакета. Можно написать почту
Installed-Size: размер программы в килобайтах