#Dev

  • Easy Excel exports from Padrino

    At some point in the lifecycle of any useful application you write, there will be a request to get something out of your system in Excel format. Here’s an easy, transparent method to get downloadable Excel reports out of your Padrino app.

    Spreadsheets are still king in most organizations and Excel is still the main tool business users and decision makers comfortably interact with, often for for end user reporting, data consolidation, or intermediary analysis purpose.

  • Securing Padrino apps with https and ssl on Heroku

    Let’s Encrypt has done an amazing job of making https the new normal for web sites and helping create a more secure and private internet by giving away free, automatic ssl certificates to domain owners.

    You should be encrypting your web traffic (and need to, to take advantage of new protocols like http/2. Some implementations have stated they will only support http/2 over an encrypted connection. And currently, no browser supports http/2 unencrypted afaik.). Add to this the fact Google will start penalizing non-secured sites in search results, and https is fast becoming the de facto standard.

  • Padrino with Foreman and Puma on Heroku

    Padrino works great on heroku with just a simple git push heroku master, but you can get a surprising bump in performance simply from using Puma in production rather than the default heroku web server.

    That also goes for using it on your local development machine, but heroku uses Procfile based spinning up of apps, so you should also test locally on your dev box, using heroku’s handy foreman before pushing it live to heroku.

  • Migrated to Jekyll

    I just recently moved the blog over to jekyll as the Jekyll team got into releasing beta versions of its 3.0 release.

    Despite it’s popularity in the Rails community for a while now (enough so it raised eyebrows at me having a roll-my-own blog system), up until 3.0 I had issues with Jekyll , but the new version seems to eliminate most of my larger bugbears.

    Strangely, the big catalyst behind the move was themes (and an interesting point of how policy can drive behaviour), as Google announcing it was going to start punishing sites that were not mobile responsive in its search results had organic traffic (and my search rankings) drop by half the week google pulled the trigger on it. Redesigning my theme from scratch to be mobile responsive seemed a lot more work than modifying someone else’s theme. But, while that probably clinched it, there were other good reasons too:

  • A better vim markdown preview

    Since I’ve moved back to using vim+tmux in the terminal for virtually all my writing and code editing (and gotten faster in a number of respects), one of the key things I’ve missed from Sublime Text 3 has been its excellent and speedy markdown preview in Chrome.

    It was a friction point in moving back to terminal vim since an old plugin I’d used before was no longer available, and the fallback I’d had to render Github-flavoured markdown was to use a combination of Tim Pope’s Dispatch and the octodown gem . It had a number of issues, one of which was the time it took to shell out and then render the preview, but more than that, it just seemed to slow everything down.

  • Enabling cron in OSX 10.10 Yosemite

    Strangely, one of the earliest things I learned in unix computing was crontab -e. In fact, it would not be an exaggeration to say, the reason I learned to use vim in the first place, was so I could fire off automated jobs in cron while I slept (Don’t ask. Mine was a complex childhood. :-) ).

    I’ve never been a fan of Apple’s launchd replacement on the OSX operating system.

  • Clojure for the Brave and True by Daniel Higginbotham

    I have to admit I really, really wanted to like this book.

    While at least one of our company offices has invested a lot in getting across Clojure as being the next big thing for some of the technical projects we could be running and it does seem interesting enough on its surface (particularly with interesting datastore developments like Datamic) and purports to solve some interesting problems that are difficult to do so in other languages, I have to admit the primary draw of the book for me was the fact the writer had a style similar to that of Why the lucky stuff whose book on Ruby sucked me back into programming and enjoying building digital products again.

  • Adding indexes with Padrino migrations

    I really like the Padrino web framework. Its simplicity and layer of just enough above Sinatra appeals to me over the burgeoning complexity of Rails of late.

    As my applications have become more complex though, the lack of documentation and good examples have become an increasing issue. I’m intending to write a few blog posts on common, yet more complex things, you need to do in Padrino to use it as a Rails replacement. Hopefully it can increase uptake and help other people with issues to solve some common gaps.

  • Setting up Hadoop on OSX Mountain Lion

    Everyone I know that deals with large amounts of data has been looking closer at Hadoop as it’s matured. Especially with tools like Hive, old datawarehouse hands are taking a serious look at it as a better type of long time data archive and storage. You probably should too.

    While most of the time for the types of real work you’d be doing, it makes more sense to spin up Amazon’s EC2, Elastic Map Reduce or another flavour of virtualized Hadoop instance in the cloud for the clustering and crunching benefits, it’s very good to have a local install for development and testing.

  • Setting up a Rails Development Environment on OSX Mountain Lion

    [Updated: 2013-01-08 - A lot of people asked for Postgres instructions]

    After my faithful Macbook Air went down hard in Tonga, I was really surprised at the number of outdated posts, misinformation and general number of questions (even on Stack Overflow), on how to install a Rails dev environment from scratch on a new OSX 10.8 Mountain Lion machine.

    This HOWTO runs from zero to getting you to what I consider a naked dev environment where you’re good enough to start and source control a project and issue a rails new command. It starts from a totally fresh install of Mountain Lion with all system updates.