Skip to content

Instantly share code, notes, and snippets.

View itsmikita's full-sized avatar
🤡
Psyborg

It's Mikita itsmikita

🤡
Psyborg
View GitHub Profile
@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 April 17, 2024 23:54
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
@itsmikita
itsmikita / HOWTO.md
Created January 15, 2023 21:54
Sublime-Text CLI on macOS 13.1 Ventura

Open Terminal and run:

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@itsmikita
itsmikita / README.md
Last active May 2, 2024 07:27
Create bootable USB drive from InstallMacOSX.pkg

Create bootable USB drive from InstallMacOSX.pkg

  1. Erase USB drive with Disk Utility using format Mac OS Extended (Journaled) and Master Boot Record and call it MyVolume
  2. Use Finder to mount/open InstallMacOSX.dmg.
  3. Run following commands:
pkgutil --expand /Volumes/Install\ OS\ X/InstallMacOSX.pkg /tmp/El\ Capitan
diskutil eject Install\ OS\ X
cd /tmp/El\ Capitan