The domain has to be simple, no abstraction Basically everybody knows the KISS principal (keep it simple, stupid). But unfortunately most of the time it get's overwritten by the DRY principle (don't repeat yourself) which gained traction through
symfony Adapt timezone for PHP worker on Heroku When working with custom timezones and Heroku, you have to make sure to add the timezone everywhere. I've published a post recently how to configure it for the web dyno
symfony Symfony Messenger with custom serializer Using the JSON serializer makes the messages a lot more readable. But there are still instances where this is not enough or might even be a step back from the
symfony Symfony messenger with JSON messages When you start a new project with the Symfony messenger component, the messages will be serialized through the PHP serialization. This has the advantages that you don't need a constructor
symfony Symfony route parameter with slash as part of the parameter Usually the parameter you put in your url looks something like this: api_with_token: path: '/api/update-user/{token}' defaults: { _controller: App\Controller\UserController::update } methods: [POST]With
heroku Adapt timezones on Heroku I'm using the dynos of Heroku and the Postgres database addon from Heroku. Both are on UTC by default and Heroku is specifically advising against changing it. So make sure
heroku Custom fonts on Heroku There are a few special buildpacks to deploy custom fonts to your Heroku dyno. The most straightforward way I found isn't documented with Heroku, but can be found through a
vuetify Checkbox group in Vuetify There is already a component for a radio group from Vuetify, but if you want to handle multiple checkboxes, you're out of luck. It doesn't seem to likely, that this
typescript Record with optional keys with Typescript The Record type in Typescript is very useful. With it you can define an abstract object in more detail. This is very helpful when building a base interface for extending.
ios Check for Safari browser Luckily browser tests aren't as necessary anymore as they used to be. But there are still situations where you going to need them. For example when using a feature only
phpstorm Don't break import in PHPStorm for Typescript When ignoring max length rules for imports in Typescript, PHPStorm still will break the imports automatically be default. But there is a setting for this: Go to Editor > Code
apache Disable cache with .htaccess Simple cache removal through .htaccess: <IfModule mod_headers.c> Header set Cache-Control "no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires 0 </IfModule>Handy when
symfony UUIDs with serializer in Symfony Internally I've long switched to UUIDs instead of auto increment columns for my Doctrine entities. But as soon as I'm in the realm of business logic or serialization, I always
htaccess Return empty options response through htaccess Many hybrid apps use the web container of the OS like WebView to render the app components. Those then also perform their API requests through the web container. Internally this
git Check for git changes with bash When running a deployment, I want to make sure, that all changes have been committed to git before it's executed. There is a special flag --porcelain for the git status
symfony Upload fixture files to Cloudcube on every review app creation The automatic creation of review apps is one of the biggest advantages of using Heroku. But what about using files in your S3 bucket? I've build a Symfony console command
heroku Add maintenance mode while still using Cors headers on Heroku Heroku offers a maintenance mode. With it, the dyno isn't reached and an iFrame with a maintenance HTML page is shown. But unfortunately it can't be customized any further than
Loop through date range of two dates in PHP Very useful when creating entries from one date to another. The basic way would be the following: $startDate = new \DateTime('2020-06-01'); $endDate = new \DateTime('2020-06-30'); for($date = $startDate; $date <
typescript Use ignore pattern of eslint for max-lenth to allow for long import lines When working with Vue and Typescript the default settings for eslint are to complain about lines longer then 140 characters. Which works great for the usual code but not for
htaccess Enforce https redirect in htaccess depending on environment variable Ever run into the the problem that you need to have a htaccess redirect on the production system but don't want to have it on your local machine? Usually today
php Serialize empty object as empty object instead of empty array with Symfony serializer The Symfony serializer now for long had the logic that any object without values will be serialized to an empty array. The problem here is for the frontend when they
vue.js Disable change on scroll for number field with Vue When working with inputs of type number, it will automatically have those arrows to increase or decrease the value. What is less obvious is that the browser will also increase
heroku Copy local files to Cloudcube (Heroku) with aws cli When migrating from an existing setup with files to an external storage like Cloudcube (which is based on S3), you already will have files in your system. Unfortunately the Cloudcube
typescript Sum numbers in array of objects with Typescript In the old days a simple for loop would be enough. It still is, but way more code then needed when working with arrays. When working with reduce we can
Use flysystem with Cloudcube on Heroku Recently I switched from a project from an usual hoster to Heroku. For the file storage we decided to use Cloudcube (because it includes a free tier we use for