There are 151 articles categorized as "Development"
on January 08, 2020. in Software, Development. A 1 minute read.
Today I had to delete all lines from a CSV file where the last column has a 1
:
Continue reading Delete lines containing a pattern in vim...
on January 08, 2020. in Programming, Development. A 2 minute read.
From time to time I come across a mistake in unit tests that makes them useless. The mistake is that we use the class and method that we are testing to create the expected result of the test:
Continue reading Don't use the class under test to create the expected result...
on January 02, 2020. in Development, Software. A 1 minute read.
Yesterday I was looking at a rather large diff, but for the type of change I was after, I wanted to look only at the newly added files. Turns out, git diff has a filtering option with --diff-filter
.
Continue reading Filter git diff by type of change...
on November 22, 2019. in Programming, Development. A 3 minute read.
Legacy code has many definitions. It is code without tests. It is code written by someone else. It is code written X time ago. It is obsolete code that is difficult to replace with newer code. It is code that has no documentation. It is all of these things.
Continue reading Unit tests in legacy code...
on March 29, 2019. in Software, Development. A 1 minute read.
PhpStorm 2019.1 was released yesterday. During the first run after the upgrade PhpStorm usually asks from what previous version would I like to import the settings from, but this time it didn’t ask that. It rather imported some of my old settings, but not the latest ones I had for 2018.3.
Continue reading PhpStorm previous version settings not imported...
on February 08, 2019. in Development, Software. A 3 minute read.
Today I was using interactive git rebase to squash some commits together to clean up the commit history of a git branch. At one point I went a bit overboard with it and squashed together two commits by mistake.
Continue reading Use git reflog to split two squashed commits...
on February 04, 2019. in Programming, Development. A 5 minute read.
A while ago I started learning bits and pieces about Vue.js by creating a single page application for one of my pet projects that I use to explore Domain-Driven Design. In general I know my way around a Javascript file, but wouldn’t call myself an expert with it. In the past I mostly used jquery, some mootools, and even Dojo. Ah, good old Zend Framework 1 times.
Continue reading Vue.js reusable components...
on February 01, 2019. in Programming, Development. A 2 minute read.
Since Symfony 3.4 the services in the service container are private by default. While this decision made us write better production code by making us use Dependency Injection more and rely on the service container less, using these services in a test environment proved to be a challenge.
Continue reading Accessing Symfony private services in Behat...
on January 18, 2019. in Programming, Development. A 5 minute read.
The other day I was creating a Symfony command that will be periodically executed by a cronjob. I decided to write a Behat test for it, to see what a test like that would look like. Plus, just because it is executed by the system from a command line, doesn’t mean we can skimp on the business requirements.
Continue reading Testing Symfony commands with Behat...
on December 24, 2018. in Development. A 2 minute read.
I’ve been using Make and Makefiles quite extensively over the past few months in my personal projects. One of the make targets I have is to run Behat tests:
Continue reading Ignore Errors in Makefile...