Notes to self

Browsing...

Following Rails redirects with Capybara

This a very short note on setting up Capybara to correctly follow redirects with Rails classic redirect_to @object pattern.

Trusted SSL certificates with Let’s Encrypt and NGINX

letsencrypt.org is the new awesomeness that happened to SSL on the web. Forget over-priced trusted certificates or self-signed certs for your side & pro bono projects. Try trusted SSL in seconds for free instead :). If you choose to use Let’s Encrypt I want to show you what needs to be done on a pretty average Fedora VPS with NGINX server and how to avoid certbot errors like urn:acme:error:unauthorized and urn:acme:error:unknownHost.

Building international invoices with InvoicePrinter 0.0.9

From the start I wanted an unobstructive and flexible API for InvoicePrinter. This flexibility enables anyone to make international duo-lingual invoices without any special i18n API provided. But the truth is I had something a bit better in mind from the beginning and in 0.0.9 I am including something new suited for the job.

Running wkhtmltopdf in Vagrant (without X server)

Chances are you might need to run wkhtmltopdf on your server or in Vagrant environment (e.g. to overcome compatibility issue such as Cannot mix incompatible Qt library (version 0x50700) with this library (version 0x50701)). That way you need to be able to run it without an actual X server.

Specifying parameters encoding by action in Rails

At work I needed to accept a Windows-1250 encoding in URL parameters on some actions in one of our Rails API endpoint. The problem is that Rails will scream at you since everything needs to come as UTF-8. Future! Unfortunately some 3rd party Windows software might be still in the past… at that time I was trying to find a way how to write a middleware or patch Rails’ ActionPack to handle this request and what I found was actually a commit that adds this to Rails in master.

RSS