Category: Dev Stuff

  • Getting started with Vim by Luca Pette

    If you want to get started with Vim, I suggest you read this article by Luca Pette.

  • Front-end Developer Handbook by Cody Lindley

    If you are in front-end development you should definitely check out this handbook by Cody Lindley. It’s packed with useful knowledge!

  • Sort an array by object attribute in PHP

    One of those simple things that I keep forgetting. Suppose you have to sort a set of PHP objects, based on an attribute. To do this, you can implement the __toString method and use the SORT_STRING flag in the sort function: <?php class Car { private $_maker; public function __construct( $maker ) { $this->maker = $maker; […]

  • @return tag for methods returning array of objects

    I always wondered how to write the @return tag for methods that return an array of objects. Today I discovered that you have to write: <?php class AnotherClass { /** * @return MyClass[] */ public function getClasses() { // logic here return $array_of_classes; } } You can read the relevant docs here.

  • Set Ubuntu desktop background from Unsplash

    I love having inspiring desktop background while I work. Often I leave a monitor free of anything, just to admire a wonderful photo. Unsplash is the perfect source for free stock photos, so I thought to set up a script to fetch a random image from Unsplash and set it as the desktop background on […]

  • Don’t collapse File headers by default in PHPStorm

    By default PHPStorm (which I love, BTW) collapses header comments. I think this is not a safe default, as I use header comment to give my fellow developers (or my future self) an overview about the file they’re going to read. To deactivate this behavior, just go to Settings > Editor > General > Code […]

  • Can you have a life outside coding?

    Life happens. People meet other people who become partners. People have kids. People build families. Developers are people. A great post by Belén Albeza

  • Update autoloader with Composer

    I keep forgetting this: to update an autoloader created with Composer issue this command $ composer dump-autoload

  • The Art of the Commit

    A great excerpt from the book “Git for humans”: The Art of the Commit

  • Resilient Web Design

    The World Wide Web has been around for long enough now that we can begin to evaluate the twists and turns of its evolution. I wrote this book to highlight some of the approaches to web design that have proven to be resilient. A great (and free) book by Jeremy Keith