A list of interesting React optimization techniques.
[1] Do less work during rendering
| const string = 'Hello, World!' | |
| // Split the a string into words while removing special characters | |
| const words = string.replace(/[!@#$%^&*()_+\-=\[\]{};:"\\|,.<>\/?]/g, '').split(' ').filter(x => x.match(/[a-z]/g)) | |
| console.log(words) |
| # Compact/compress the size of an Ubuntu VDI file on VirtualBox (v7.0) | |
| # Run this script in the Ubuntu VM running in VirtualBox | |
| # Shut down the VM after then run "compact.bat" on the Windows host | |
| df -h | |
| echo "Nullifying free space..." | |
| sudo dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k status=progress ; sudo rm -f /var/tmp/bigemptyfile |
| :: Compact/compress the size of an Ubuntu VDI file on VirtualBox (v7.0) running in a Windows host | |
| :: The VDI file should should have previously run "compact.sh" in the VM before running this script | |
| :: Add VBoxManage.exe to the PATH variable to make it globally available. Usually it's in | |
| :: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe | |
| VBoxManage.exe modifymedium --compact c:\path\to\thedisk.vdi |
A list of interesting React optimization techniques.
[1] Do less work during rendering
| #!/bin/bash | |
| # Prints the version of a nodejs package.json file | |
| VERSION=`node -e "console.log(require('../app/package.json').version)"` | |
| echo Synchronizing all modules to version $VERSION |
Highlighted block quotes for GitHub MD files
Reference: https://github.com/orgs/community/discussions/16925
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> [!TIP]