Skip to content

Instantly share code, notes, and snippets.

View itsmikita's full-sized avatar
💭
Jemanden passiert etwas

It's Mikita itsmikita

💭
Jemanden passiert etwas
View GitHub Profile
@itsmikita
itsmikita / adjectives.js
Created October 22, 2023 18:04
Generate Random People Names and Phrases
// the list is generated by a custom ml agent
export const adjectives = [
"benevolent",
"charming",
"diligent",
"elegant",
"fantastic",
"graceful",
"humble",
"inquisitive",
@itsmikita
itsmikita / d2h.sh
Created October 15, 2023 15:58
Convert Decimals to Hexadecimals and backwards in Shell
#!/bin/bash
# convert decimal (0-255) to hexadecimal (00-FF)
function d2h() { printf "%X\n" $1 }
@itsmikita
itsmikita / blur-safari.css
Last active December 18, 2023 23:28
CSS Blur Backdrop Filter in Safari
/* FROM APPLE.COM */
@supports ((-webkit-backdrop-filter: saturate(180%) blur(20px)) or(backdrop-filter: saturate(180%) blur(20px))) {
#globalnav.globalnav-scrim, .globalnav-scrim #globalnav {
--globalnav-backdrop-filter: saturate(180%) blur(20px);
--globalnav-background: rgba(251, 251, 253, .8)
}
}
#globalnav.globalnav-scrim.globalnav-dark, .globalnav-scrim.globalheader-dark #globalnav, .globalnav-scrim #globalnav.globalnav-dark, .globalheader-dark #globalnav.globalnav-scrim {
@itsmikita
itsmikita / macos-iso.md
Last active November 25, 2025 01:32
Extract ISO image from macOS Somona installer
@itsmikita
itsmikita / Caddyfile
Created September 16, 2023 04:54
Hot-reloading PHP with `bun.js` and `Caddy`
localhost
root * public
encode gzip
php_fastcgi 127.0.0.1:9000
file_server {
index index.php index.html
}
@static {
file
path *.ico *.css *.js *.gif *.webp *.jpg *.jpeg *.png *.svg *.woff *.woff2
@itsmikita
itsmikita / __download_svgs.js
Created July 28, 2023 14:18
Find and download inline SVG images.
// @url https://t-hamano.github.io/wordpress-icon-list/
let __download_svgs = () => {
const kebaptize = ( t ) => t.split( "" ).map( ( c, x ) => c === c.toUpperCase() ? `${ x != 0 ? "-" : "" }${ c.toLowerCase() }` : c ).join( "" );
let svg, file, a, allow = [ "xmlns", "viewBox" ];
document.querySelectorAll( ".iconlist button" ).forEach( ( btn, x ) => {
a = document.createElement( "a" );
a.innerHTML = btn.innerHTML;
btn.replaceWith( a );
svg = a.querySelector( "svg" );
console.log( x, svg );
@itsmikita
itsmikita / removeAllEventListeners.js
Created July 28, 2023 13:04
Remove all EventListeners assigned to a Node. #hack
/**
* When it was not you who added the EventListeners on a Node... Remove'em all!!!
*
* @param element
*/
const removeAllEventListeners = element => element.outerHTML += "";
@itsmikita
itsmikita / kebaptize.js
Created July 28, 2023 11:43
Convert CamelCase (or AnyCase) to kebab-case.
const kebaptize = ( t ) => t.split( "" ).map( ( c, x ) => c === c.toUpperCase() ? `${ x != 0 ? "-" : "" }${ c.toLowerCase() }` : c ).join( "" );
@itsmikita
itsmikita / README.md
Last active October 15, 2023 21:25
Merge a git branch into master

To merge a git branch into master:

git fetch
git rebase origin/master
git checkout master
git pull origin master
git merge [branch]
git push origin master
@itsmikita
itsmikita / .zprofile
Created June 21, 2023 07:56
A tiny shortcut function to switch between PHP versions on macOS.
# switch php version
function switch_php() {
brew services stop php@7.4
brew services stop php
brew unlink php@7.4
brew unlink php
case $1 in
7.4)
brew services start php@7.4
brew link php@7.4