Sexy Technologies

Here is my current round-up of technologies that are still getting my blood pumping. The irony here is kind of intentional because not many of these are widely considered to be that sexy. Hint:  From an engineering perspective I believe best practices usually trump new and shiny.

Read more...

JSON Files and emacs

I got tired of emacs not knowing I was essentially editing javascript files while writing JSON so I started to look into JS2-mode until I realised it was kind of overkill. Then I saw this comment that suggested telling emacs to use the inbuilt syntax handling for javascrpt for json files too!

(setq auto-mode-alist (cons '("\\.json\\'" . js-mode) auto-mode-alist))

Read more...

RedBean Models with Composer

I've finally got to the point where I want to use custom model classes with the RedBean ORM. I personally think this sure speaks volumes for the technology after already using it for various projects for around a year because, as a result, it's reconfirming it's ability to provide 'schemaless' development compared to other ORM technologies. (See DBIx::Class, Doctrine, ActiveRecord etc). Being a Composer convert I automatically wanted to have my models residing in a 'namespaced location' inside my (Empathy) web apps so that they could be auto loaded for me. Although I appreciate the RedBean creator's views on namespaces in PHP, because I think less is often more, I've simply always been a fan, especially since I started to use Composer and becoming aware of the PSR 0 autoloading standard. So assuming I have some 'Acme' components in my web app I would declare them according to the composer documentation as such:

{
    "autoload": {
        "psr-0": {"Acme": "src/"}
    }
}

Read more...