Skip to content

Instantly share code, notes, and snippets.

View julianxhokaxhiu's full-sized avatar
🚀
Impossible Is Nothing.

Julian Xhokaxhiu julianxhokaxhiu

🚀
Impossible Is Nothing.
View GitHub Profile
<?php
/**
* Dot notation for access multidimensional arrays.
*
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]);
*
* $value = $dn->get('bar.baz.foo'); // $value == true
*
* $dn->set('bar.baz.foo', false); // ['foo'=>false]
*
@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active April 15, 2024 22:49
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Last active March 25, 2024 16:15
Simple bash script to create a Bootable ISO from macOS Catalina Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
hdiutil create -o /tmp/Catalina.cdr -size 9000m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Catalina.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build --nointeraction
hdiutil detach "/Volumes/Install macOS Catalina"
@julianxhokaxhiu
julianxhokaxhiu / build.sh
Last active February 19, 2024 22:04
How to build minimal ARM QEMU Static from sources with EXECVE
#!/bin/bash
#
# IMPORTANT!
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
#
###########
# Add Backports repo support
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created October 31, 2022 12:31
Simple bash script to create a Bootable ISO from macOS Ventura Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~16 GB
DISK_SIZE="15361m"
@julianxhokaxhiu
julianxhokaxhiu / README.md
Last active December 5, 2023 07:52
Enable autodiscover AirPlay Client support on Arch Linux ( like on macOS )

Enable autodiscover AirPlay Client support on Arch Linux ( like on macOS )

Step 1

Install required dependencies

$ pacman -S avahi pulseaudio-zeroconf

Step 2

@julianxhokaxhiu
julianxhokaxhiu / README.md
Last active November 4, 2023 11:05
Windows 11 22H2 - Create local account on first boot and other useful tricks

Create a local account on Windows 11 22H2 clean install ( and first boot ):

NEW METHOD

Feel free to try this method if it works, if not switch back to the old one below.

  1. Reach the account creation and choose Personal Account
  2. Use as email test@test.com
  3. Use as password test
  4. Let Windows 11 fail the login and click Next
@julianxhokaxhiu
julianxhokaxhiu / build.sh
Last active July 12, 2023 06:06
How to build minimal AARCH64 QEMU Static from sources with EXECVE
#!/bin/bash
#
# IMPORTANT!
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
#
###########
# Add Backports repo support
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created October 3, 2018 12:04
Simple bash script to create a Bootable ISO from macOS Mojave Install Image from Mac App Store
#!/bin/bash
#
# How to use:
# 1. copy this shell file somewhere in your Mac
# 2. chmod +x create-iso.sh
# 3. $ sudo ./create-iso.sh
#
# The ISO file will be located in your Desktop when the script will be complete
hdiutil create -o /tmp/Mojave.cdr -size 6000m -layout SPUD -fs HFS+J
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Last active June 18, 2023 08:11
Simple bash script to create a Bootable ISO from macOS Big Sur Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~13.5 GB
DISK_SIZE="13000m"