Understanding align-regexp of Emacs

Emacs' M-x align-regex is neat when I want to align some similar text, especially when we're coding. I use its trivial version(without prefix arg) regularly on day-to-day programming work before. For example, I can use it to align below code quickly by: Choose the region M-x align-regexp and type = and Enter aaaaaaaaaaaaaa = fields[0] bbb = fields[1] cccccccc = fields[2] It will be aligned to below code, now it's better to read: [Read More]

Render erd Diagrams Online

If you ever wonder how to plot ER diagrams in plain text, you may have already heard of erd. It's a cool command line program written by Andrew Gallant in Haskell, to "compile" plain text files into nicely looking images, leveraging the power of GraphViz. I've used erd for some time, it's cool and the syntax is quite simple. It's also quite simple to install it on Linux, just install GraphViz and erd itself, by following the instructions in the README page. [Read More]

Fine-tune Curly Braces Style of yasnippet Snippet on the Fly

Yasnippet is a good friend to help us type less and write more, whenever we write some text snippets repeatedly. And there is also an official repository called yasnippet-snippets that contains various snippets for many programming languages(modes), so that we can have many snippets in no time by installing it. But there is a little problem when it comes to conforming to different coding styles. Take the if snippet for example, normally it will generate code like this: [Read More]