Skip to content

Instantly share code, notes, and snippets.

View isocroft's full-sized avatar
😜
Seriously fooling around!

Ifeora Okechukwu Patrick isocroft

😜
Seriously fooling around!
View GitHub Profile
<!-- i have to warn you, this code SUCKS! i DO NOT recommend using this code, but you can if you want -->
<div style="width:calc(442px + 28px * 2); outline:1px solid #232323; border-radius:8px;position: absolute;top:0;left:0;translate:calc(50vw - 50%) calc(50vh - 50%); box-sizing: border-box;container-type: size;height:600px;contain:strict">
<div style="overflow: clip;contain:strict;width:100%;height:100%;position:absolute">
<div style="padding:28px;display: flex;height:100%;box-sizing:border-box;flex-direction: column;align-items: center;justify-content: center;">
<svg class="nv-block sm:nv-hidden nv-h-6 nv-w-auto" style="width:100px;margin-top:2px" viewBox="0 0 1230.574 519.774" xmlns="http://www.w3.org/2000/svg" aria-label="Cloudflare"><path d="m784.025 512.011 5.872-20.311c6.998-24.169 4.394-46.511-7.349-62.926-10.801-15.122-28.804-24.022-50.666-25.056l-414.114-5.281c-2.788-.147-5.096-1.403-6.518-3.471-1.44-2.123-1.773-4.856-.886-7.478 1.366-4.08 5.41-7.164 9.62-7.349l417.954-5.299c49.576-2.271 103.2
@isocroft
isocroft / falsehoods-programming-time-list.md
Created March 18, 2026 22:32 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@isocroft
isocroft / decode.go
Created March 9, 2026 01:21 — forked from nl5887/decode.go
Golang implementation for RFC 1342: Non-ASCII Mail Headers
package main
import (
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"mime/quotedprintable"
"regexp"
"strings"
@isocroft
isocroft / mid_budget_event_plan_and_management_app.sql
Last active February 13, 2026 13:29
A database schema for an event plan and management app that is Meetup-like using either MySQL, SQLite or PostgreSQL as primary database
-- MySQL v8.0.16
-- PostgresSQL v16.9.2
CREATE DATABASE IF NOT EXISTS `test`
DEFAULT CHARACTER SET utf8 -- utf8mb4
DEFAULT COLLATE utf8_general_ci; -- utf8mb4_unicode_ci
SET default_storage_engine = INNODB;
CREATE TABLE speakers (
@isocroft
isocroft / service-workers.md
Created February 2, 2026 20:15 — forked from Rich-Harris/service-workers.md
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@isocroft
isocroft / react-router-dom-v.6.02.prompt.blocker.js
Created January 12, 2026 13:04 — forked from rmorse/react-router-dom-v.6.02.prompt.blocker.js
Adds back in `useBlocker` and `usePrompt` to `react-router-dom` version 6.0.2 (they removed after the 6.0.0 beta, temporarily)
/**
* These hooks re-implement the now removed useBlocker and usePrompt hooks in 'react-router-dom'.
* Thanks for the idea @piecyk https://github.com/remix-run/react-router/issues/8139#issuecomment-953816315
* Source: https://github.com/remix-run/react-router/commit/256cad70d3fd4500b1abcfea66f3ee622fb90874#diff-b60f1a2d4276b2a605c05e19816634111de2e8a4186fe9dd7de8e344b65ed4d3L344-L381
*/
import { useContext, useEffect, useCallback } from 'react';
import { UNSAFE_NavigationContext as NavigationContext } from 'react-router-dom';
/**
* Blocks all navigation attempts. This is useful for preventing the page from
* changing until some condition is met, like saving form data.
@isocroft
isocroft / inferal-workspace-architecture.md
Created December 24, 2025 21:50 — forked from yrashk/inferal-workspace-architecture.md
Inferal Workspace Architecture

Inferal Workspace Architecture

Your org's brain that AI can use

This document describes the conceptual architecture of the Inferal Workspace - a text-based, version-controlled knowledge and operations hub designed to replace tools like Notion and Webflow while being natively accessible to AI assistants.

Why We Built This

As an engineering-driven organization, we found ourselves fighting our tools instead of using them. Notion couldn't keep up with how we actually work - context scattered across pages, no version control, and AI that could read but not act. Webflow meant our website lived in a silo, disconnected from our codebase and deployment pipelines. Every tool was another tab, another context switch, another place where knowledge went to die.

@isocroft
isocroft / not_breaking_the_rules_of_hooks_react.js
Last active November 13, 2025 00:04
A simple use of a feature flag hook where the 1st rule of hooks in ReactJS is seemingly broken but not broken at all
function useXFeature (user, { xFeatureName = "", pageAndSection = "." } = {}) {
/* @NOTE:
This `useFeatureFlagConfig(...)` is static an immutable.
It can't change/be updated at runtime.
*/
const { isEnabledFor, loading } = useFeatureToggle(user);
if (isEnabledFor(xFeatureName, pageAndSection)) {
return useXFeature_Newer_Implementation_Stable();
@isocroft
isocroft / circuit_breaker_retry_protocol.md
Last active November 17, 2025 14:24
A protocol specification for how an arbitrary HTTP client can communicate with a reverse proxy (circuit breaker server) that forwards requests to a target service in such a way that does not require the HTTP client to blindly send retry requests.

Introduction

This is a specification that delineates how an arbitrary HTTP client should communicate with a circuit breaker so that it can know when to retry requests while the circuit breaker is in an OPEN (i.e. full-open & half-open) state and when the circuit breaker transitions to a CLOSED state. Remember, the circuit breaker is a reverse proxy that forwards requests to a target server/service in such a way that does not require the HTTP client to blindly send retry requests.

Screenshot 2025-11-17 at 2 52 20 PM Screenshot 2025-11-17 at 2 52 38 PM Screenshot 2025-11-17 at 2 52 56 PM

There are 2 ways in which the circu

@isocroft
isocroft / mid_budget_online_dating_app_design_database.sql
Last active February 14, 2026 09:40
A database schema for a Tinder-clone dating app using either MySQL, SQLite or PostgreSQL as primary database
-- MySQL v8.0.16
-- PostgresSQL v16.9.2
CREATE DATABASE IF NOT EXISTS `test`
DEFAULT CHARACTER SET utf8 -- utf8mb4
DEFAULT COLLATE utf8_general_ci; -- utf8mb4_unicode_ci
SET default_storage_engine = INNODB;
CREATE TABLE user_details (