Skip to content

Instantly share code, notes, and snippets.

View raoulwegat's full-sized avatar

Raoul Wegat raoulwegat

View GitHub Profile
@raoulwegat
raoulwegat / _readme.txt
Last active May 2, 2023 08:16
Including Photoswipe 5.2+ with laravelmix/webpack 4
Photoswipe 5.2 was rewritten in ES6 and it needs to be transpiled to ES5 to work with Laravel Mix 4 (which used Webpack 4).
If you try a regular import as per the Photoswipe docs, it won't work. You'll need to add this webpack config to your
webpack.mix.js and import the modules in your js file as per below.
@raoulwegat
raoulwegat / Get PHP-FPM Average Memory Usage.md
Last active September 16, 2023 04:32
PHP-FPM Average Memory Usage.md

Get PHP-FPM Average Memory Usage

ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | grep php-fpm
@raoulwegat
raoulwegat / override puppeteer default browser.md
Created October 18, 2023 00:29
override puppeteer default browser.md

override puppeteer default browser

When using criticalCSS on Apple Silicon hardware in an arm64 linux virtual machine, puppeteer installs an x86-64 version of chromium which will not launch and will cause and npm run command to fail.

This problem can be solved by firstly installing chromium-browser which is a native arm64 and x86-64 build:

sudo apt install chromium-browser