Skip to content

Instantly share code, notes, and snippets.

View omrilotan's full-sized avatar

omrilotan omrilotan

View GitHub Profile
@NV
NV / Readme.md
Last active May 17, 2024 03:38
Prepend the debugger statement to a function as easy as stopBefore('Element.prototype.removeChild'). Works in Chrome DevTools and Safari Inspector, doesn’t work in Firebug‘s and Firefox Developer Tools‘ console (I don’t know why). Works as a standalone script everywhere.

stopBefore.js

2min screencast

Examples

stopBefore(document, 'getElementById')
stopBefore('document.getElementById') // the same as the previous
stopBefore(Element.prototype, 'removeChild')
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active June 23, 2024 21:35
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@egyjs
egyjs / Direct Link of YouTube videos.md
Last active April 17, 2024 06:38
PHP API To get Direct Link of YouTube videos
@wilsonpage
wilsonpage / swr.ts
Last active June 1, 2024 02:09
An implementation of stale-while-revalidate for Cloudflare Workers
export const CACHE_STALE_AT_HEADER = 'x-edge-cache-stale-at';
export const CACHE_STATUS_HEADER = 'x-edge-cache-status';
export const CACHE_CONTROL_HEADER = 'Cache-Control';
export const CLIENT_CACHE_CONTROL_HEADER = 'x-client-cache-control';
export const ORIGIN_CACHE_CONTROL_HEADER = 'x-edge-origin-cache-control';
enum CacheStatus {
HIT = 'HIT',
MISS = 'MISS',
REVALIDATING = 'REVALIDATING',
@jherskow
jherskow / scripts.sh
Last active September 6, 2022 12:33
Useful Shell Scripts
# print a line and then execute it. useful for composing scripts.
function peval() {
echo ">> $*"
eval $*
}
#grab path to project folder from git
function git_path() {
echo $(git rev-parse --show-toplevel)