Paul's Latest Public Bookmarks
Taking screenshots To capture a screenshot of a page, use the --screenshot flag: chrome --headless --disable-gpu --screenshot https://www.chromestatus.com/ # Size of a standard letterhead. chrome --headless --disable-gpu --screenshot --window-size=1280,1696 https://www.chromestatus.com/ # Nexus 5x chrome --headless --disable-gpu --screenshot --window-size=412,732 https://www.chromestatus.com/ Running with --screenshot will produce a file named screenshot.png in the current working directory. If you're looking for full page screenshots, things are a tad more involved. There's a great blog post from David Schnurr that has you covered. Check out Using headless Chrome as an automated screenshot tool .
Saved by: Paul on 8 May 2017
Way of controlling Vagrant boxes, e.g. for Laravel builds where need different PHP versions. As recommended from this comment: https://laracasts.com/discuss/channels/servers/how-do-i-setup-2-homestead-boxes-one-with-php-56-and-one-with-php-7 Have a look at PuPHPet you can define a VM really simply there, just create 2 (setup once and then just change the PHP version and download the archive again) and Bob's ya Uncle. If you set 2 different IP addresses (instead of just changing the PHP version), you should also then be able to have both VMs running side by side without a problem. Normally I run one VM for multiple sites as it's simpler than having lots of separate vagrant / vm setups, but if I need something specific (ie: closer to a different production environment) then I'll just create another config specific for that project / set of projects. Whilst Homestead worked for me.. I found this to offer far more flexibility (and for me, the option to use VMware over VirtualBox for better performance / reliability too, albeit not free).
Saved by: Paul on 12 Apr 2017