Using tables with Markdown in Redmine

We use Redmine for our project management needs in the office.  It works pretty well, but there are, as with anything, a few rough corners.  One thing in particular that I was trying to figure out is how to use tables in Wiki pages, issues, etc.

The official documentation says that tables are not supported and you need to use HTML.  Yuck.  I do, of course, know how to mark up tables in HTML, but that’s definitely not the most pleasant of experiences.  Especially if you need to modify them later.  So I dug deeper.

It turns out that the documentation is outdated.  Modern Redmine versions (we are on 3.3.0) use the redcarpet library for parsing Markdown, which supports tables just fine.  Here is an example of the Markdown that you can use in pretty much any textarea field:

| Header 1     | Header 2     |
| ---          | ---          |
| Row 1 Cell 1 | Row 1 Cell 2 |
| Row 2 Cell 1 | Row 2 Cell 2 |

And it’ll render as a table just fine. The dashed line separating headers should have at least 3 dashes for the parser to understand it correctly. But you can extend the dashes for the whole width of the column.

tagbar-phpctags : Vim plugin for PHP developeres

phpctags

If you are using Vim editor to write PHP code, you probably already know about the excellent tagbar plugin, which lists methods, variables and the like in an optional window split.  Recently, I’ve learned of an awesome phpctags-tagbar plugin, which extends and improves this functionality via a phpctags tool, which has a deeper knowledge of PHP than the classic ctags tool.

Once installed, you’ll have a more organized browser of your code, with support for namespaces, classes, interfaces, constants, and variables.

The curious case of the switch statement

The curious case of the switch statement” is a nice historical perspective on the switch statement in most modern programming languages, where it come from, and how it transformed over the years.  It starts of with ALGOL 58 (yes, a programming language from 1958), and traces the history down to the modern reincarnation of the statement to BCPL (1967!), where it looked like this:

switchon EXPR into {
    ...
    ...
    case CONST:
    ...
    ...
    default:
    ...
    ...
}

Apart from the historical perspective, there is an interesting discussion about how different languages approached the statement, how it varies, and what are some of the benefits of each implementation.

O’Reilly Free Programming Ebooks

books

O’Reilly is giving away some programming ebooks for free.  Not the greatest of selections, but might still come handy, as subjects vary from Java and Python to micro-services and software architecture.  The books are available in ePub, Mobi, and PDF, but you’ll need to register / login to download them.

PHP: array_merge_recursive() vs. array_replace_recursive()

Here is a nice blog post describing the important differences between array_merge_recursive() and array_replace_recursive() functions in PHP.  These are often overlooked when testing new developments with simpler data structures.  Troubleshooting for it later is not too obvious.