Skip to content

Instantly share code, notes, and snippets.

View flipeador's full-sized avatar
๐Ÿ‡ฆ๐Ÿ‡ท

Matรญas Juarez flipeador

๐Ÿ‡ฆ๐Ÿ‡ท
View GitHub Profile
@flipeador
flipeador / clear-github-gist-revisions-history.bat
Last active March 27, 2026 16:24
Clear GitHub Gist revisions history.
git checkout --orphan latest_branch
git add -A
git commit -am "commit"
git branch -D main
git branch -m main
git push -f origin main
@flipeador
flipeador / clear-windows-thumbnail-icon-cache.bat
Last active May 5, 2025 23:33
Clear the Windows thumbnail and icon cache for all users.
@echo off
setlocal enabledelayedexpansion
for /d %%d in (%SystemDrive%\Users\*) do (
set "file=%%d\AppData\Local\IconCache.db"
set "files=%%d\AppData\Local\Microsoft\Windows\Explorer\iconcache*"
del /f /q "!file!"
del /f /q /s "!files!"
)
@flipeador
flipeador / shellex.ahk
Created August 2, 2024 19:27
Enumerate and invoke commands from the shellex context menu.
;@Ahk2Exe-ConsoleApp
/************************************************************************
* Enumerate and invoke commands from the shellex context menu.
*
* 1) Install AutoHotkey v2.
* https://www.autohotkey.com/download/ahk-v2.exe
*
* 2) Compile this script: Right click โ†’ Show more options โ†’ Compile script.
* 3) Run 'shellex.exe' from the command prompt (cmd.exe) to see the help.
@flipeador
flipeador / image-sprites.md
Last active August 27, 2025 16:11
Create CSS/SVG image sprites.

Image Sprites

An image sprite is a collection of images put into a single image or file.

Helps reduce the number of HTTP requests, memory and bandwidth usage.

They are often used to significantly improve performance in emoji selectors.

Raster Sprites

@flipeador
flipeador / asynchrony-concurrency-simultaneity.md
Created June 21, 2024 03:25
Asynchrony, concurrency and simultaneity.

Asynchrony - Concurrency - Simultaneity

๐Ÿ”„ Synchrony

Synchrony implies that the execution of multiple tasks occurs sequentially one after the other. Tasks are like steps that are executed in order, each operation blocks the others until completion.

Task #1   โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค............................
Task #2   .............โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค..............
@flipeador
flipeador / finalization-registry.js
Last active December 26, 2024 03:49
JavaScript FinalizationRegistry & WeakRefs.
const $REF = Symbol();
const $DEL = Symbol();
/**
* Set a cleanup callback for the specified object.
* @param {object} target
* The target value to register.
* @param {Function} callback
* Function called when the target is garbage-collected.
* @returns {Function}
@flipeador
flipeador / unicode-characters-emojis.md
Last active January 24, 2025 17:28
Unicode characters and emojis.

Unicode Characters & Emojis

A character is an overloaded term that can mean many things. This gist will briefly touch on the differences between Code Point, Code Unit, Grapheme and Glyph, with a particular focus on emojis.

Tip

Use [Full Emoji Support For All Websites][emoji] to ensure correct rendering of all emoji graphemes on any website.

Code Point

@flipeador
flipeador / discord-app-protocols.md
Last active July 19, 2025 01:22 — forked from ghostrider-05/discord_app_protocols.md
Discord App Protocols

Discord App Protocols

Home

discord://-/<url>

Name URL
Friends channels/@me
Nitro store
@flipeador
flipeador / language-sensitive-relative-time-formatting.js
Last active April 18, 2025 01:44
Language-sensitive relative time formatting in JavaScript.
/**
* Language-sensitive relative time formatting.
* @see https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat
* @example
* // now
* console.log(formatRelativeTime(
* '2000/01/01 00:00:00',
* '2000/01/01 00:00:00'
* ));
*
@flipeador
flipeador / zero-width-character-encoding.js
Last active August 6, 2024 17:41
Zero-width character encoding in JavaScript.
const str = encode('โ†’<Hello.World/>โ†');
console.log('encoded:', `_${str}_ (${str.length})`);
console.log('decoded:', decode(str));
function encode(str, off='โ€‹', on='โ€Œ', sep='โ€') {
return [...(new TextEncoder()).encode(str)].map(byte => (
byte.toString(2).split('').map(bit => (bit === '0' ? off : on))
).join('')).join(sep);
}