Code Snippets
The following short code snippets which can be useful for developers. If I needed to look these up more than once, I added them here.
- Installing Docker and Docker Compose en Ubuntu 20
- Solving The document could not be autosaved. The file name is invalid. on macOS
- Making Transferwise CSV import correctly into Google Sheets
- Sometimes you really want an infinite redirect: how to create one with mod_rewrite
- Using Babel in Docker to convert a javascript file
- Getting the final URL after redirects
- Installing Docker and Docker-compose on Ubuntu 16
- Docker-compose cp
- Getting a Docker container's dynamic port on the command line
- systemd as a replacement for cron every 10 seconds
- Adding profiling to your D7 simpletests
- Converting an array to PHP code
- Cleaning up after a failed bash script
- Search and replace on the command line
- Get the directory where a script resides and where it was called from
- Detecting overridden features in an automated test
- Making sure no two features define the same permission
- Using git's --graph option to view branch history in the command line
- arc diff and ERR_CLOSED: This revision has already been closed.
- Timing the execution of a command-line script
- Uploading of files within a test
- Removing a role from a feature
- Embedding a view and intercepting its output in your code
- Removing a field from a feature
- Using masquerade on user profiles
- Adding a human-readable timestamp to automatically generated files
- In tests, finding patterns in mail messages
- Updating dependencies with a function
- A Drupal 8 site deployment module
- settings.php setup when using multiple domains
- Basic install file for a deployment module
- Get the latest NID in the system
- Avoid reverting features just enabled
- Failing fast
- Deploying language negociation settings
- Deploy IMCE profile-role setup
- Erasing old builds on Jenkins to free up space
- Removing a field in code
- Development module
- Printing a structured variable during a simpletest
- Flushing your image style
- Test class method to create user for a given role
- Run all update hooks in the install hook
- Use admin menu instead of the toolbar
- Basic Unit test
- Disabling Blocks
- Enable theme
- Basic test