Skip to content

Instantly share code, notes, and snippets.

View yiminghe's full-sized avatar

yiminghe yiminghe

View GitHub Profile
@yelouafi
yelouafi / algebraic-effects-series-3.md
Last active March 27, 2025 04:33
Delimited Continuations
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@OnurGvnc
OnurGvnc / clearBrowserExtensionInjectionsBeforeHydration.ts
Last active September 24, 2024 09:20
removes injected HTML codes from browser extensions for react hydration
import { RemixBrowser } from '@remix-run/react'
import { startTransition, StrictMode } from 'react'
import { hydrateRoot } from 'react-dom/client'
function clearBrowserExtensionInjectionsBeforeHydration() {
document
.querySelectorAll(
[
'html > *:not(body, head)',
'script[src*="extension://"]',