I’m sharing this animation my 12 year old made for her big elementary school graduation ceremony. I am very proud of her. (In Québec, highschool starts in grade 7. Bonne chance pour la prochaine étape!)
When you get a new Macbook Pro with M1 chip you get an old version of Bash.
Bash isn’t old. It’s still being maintained. It has millions of Linux and Windows users. Here’s how to put the newest version of Bash back inside your MacOS box.
reiterationsis an electronic-book containing 24 sonnets. Depending on the e-book reader that is used, each time reiterations is opened, or each time a page in the book is turned, a JavaScript software integrated into the book recomposes the book’s 24 sonnets. In this way, the book automatically generates a new and unique reading experience with each reading. Each time the poems are generated the previous versions are lost and cannot be retrieved. The number of unique sonnets produced by the software is inhumanly vast.
Running Ubuntu 22.04 LTS on Windows 11 is a breeze.
First, install Windows Terminal and Ubuntu from the Microsoft store. Next, in Ubuntu, setup your .bash_aliases hacks and sudo apt installs. Finally, windows_98_tada.wav
Tip 1: Make sure the line endings in your .bash_aliases file are LF and not CRLF or you’ll get weird “not found” errors. Tip 2: cd-home is my alias to cd /mnt/c/Users/ME
If you’re like me, a developer who wants Ubuntu not Windows to be the main environment when working, create a /etc/wsl.conf file with:
This makes file permissions in /mnt/c behave like how you would expect in Linux. More info.
After this change all files in /mnt/c/Program Files/ and /mnt/c/Program Files (x86)/ requires the WSL terminal to be started as administrator to be able to modify permissions (aka chmod +x) and it is not currently possible to change permissions in /mnt/c/Windows/
To make Git in Windows more compatible with your workflow (not Git in Ubuntu leave it alone) add this to your .gitconfig
This blog post is about Spiral Framework and Roadrunner Server. I’ll briefly talk about what they are, then show how to compile a custom Roadrunner server, start developing with Spiral, using Docker.
Explain Like I’m 5 PHP Developers
Roadrunner works by creating a HTTP server with Golang’s excellent net/http package, and using Goridge as a bridge to pass PSR7 Request and Responses between PHP and Go. The PHP application is then a long-running, already bootstrapped PSR7-capable application that received the already parsed PSR7 request, dispatches it, and collects the response to give back into Go. [1]
Roadrunner offloads unnecessary operations from PHP to a more optimized server, and effectively swaps out the classic setup of Nginx+FPM with a PHP/Golang application that boosts flexibility and performance. [2]
Roadrunner can serve static files without the presence of Nginx, therefore, simplifying the creation of Docker containers. [3]
You can extend your PHP application by including Go libraries, [4], writing Go HTTP middleware, [5], or tweaking and extending the Roadrunner server. [6]
Spiral is a PHP Framework with a customized Roadrunner server. The main difference is that, when you use Spiral’s version of Roadrunner, it comes with more out-of-the-box solutions for PHP developers, Ie.
cd ~/hello-spiral
mkdir server
cd server
wget https://raw.githubusercontent.com/spiral/framework/master/main.go
wget https://raw.githubusercontent.com/spiral/framework/master/go.mod
Useful if the commits on your branch are sloppy, and you want to clean them up, and you don’t mind that your new commits will be file based instead of time based.
What does that mean exactly? Let’s say you worked two days on 3 files. (One of the files was a class, another a config, and the third a unit test.) Over the course of two days you made 13 commits. Sometimes a commit was to one file, sometimes a commit was to both, sometimes all three… 13 times! (Sloppy! You should be ashamed.) After running the script below you will lose 13 commits but can restage and create either a single commit message, or up to 3 new commit messages: One for each file. (Clean! Dick Grune approved.)
Useful if you’re too lazy to use rebase with fixup. Instead, just run one cheap and barely good enough bash script and you’re done. So lazy in fact you’re scrolling through all these words not even reading them, get to the script already.
Useful in scenarios where GitHub’s Squash & Merge interface is unavailable.
Prerequisites before running the script below, where feature/foo is your branch:
After running this script your files will be staged. You can either rewrite a nice single commit message for all the files, restage and commit in batches, or undo.
Montrealer’s who won’t let PHP go (pun intended), get in on that sweet venture capital? Here are two fantastic PHP options for doing machine learning (ML), artificial intelligence (AI), and unprecedented memorization (Singularity), in a dev stack we’re already pretty good at:
Because my project is a WordPress plugin, and because WordPress has unresolved issues older than my 9-year-old, they don’t support PHPUnit 8, yet.
Lucky for me, unlucky for the maintainer who would rather not support this gross hack, pcov works with PHPUnit 7, and probably PHPUnit 6, thanks to pcov-clobber.
PHPUnit without Xdebug took 5 minutes. PHPUnit with Xdebug (to generate code coverage reports) took ~50 minutes. This was too long for Travis CI. The job would crash, abort, and never finish code coverage.
Fixed by switching to phpdbg. It ran 10x faster. Maybe the code coverage metrics were a bit worse but at least it ran.
All was well until it wasn’t. Last week phpdbg started crashing Travis CI with [PHP Fatal error: Out of memory].
I needed another solution. Enter pcov.
How to switch to pcov if you are stuck with PHPUnit 7