Skip to content

Instantly share code, notes, and snippets.

View b3nab's full-sized avatar

Ben Abbenanti b3nab

View GitHub Profile
@pbojinov
pbojinov / canada_states_titlecase.json
Last active May 18, 2024 17:28 — forked from mshafrir/states_hash.json
US states & Canadian Provinces in JSON form
[
{
"name": "Alberta",
"abbreviation": "AB"
},
{
"name": "British Columbia",
"abbreviation": "BC"
},
{
@spacepatcher
spacepatcher / Breach Compilation (1.4 billion credentials) in Postgres.md
Last active August 28, 2024 18:34
Breach Compilation (1.4 billion credentials) in Postgres.md

What would you need:

Hardware requirements

@craigtaub
craigtaub / React-Hooks.js
Last active April 22, 2023 16:58
Nested React Hooks
// Engine
const React = {
index: 0,
state: [],
useEffect: (callback, dependencies) => {
const cachedIndex = React.index;
const hasChanged = dependencies !== React.state[cachedIndex];
if (dependencies === undefined || hasChanged) {
callback();
@ciiqr
ciiqr / zod-optional-null.ts
Last active October 8, 2024 12:44
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{