RSSAmplifier

Blog

Juanda

...

juanda.meRSS feed ↗10 posts

Latest posts

Setting Up Local HTTPS Development with Caddy and Rails

Modern web development often requires HTTPS even in local environments to properly test features like service workers, secure cookies, or third-party integrations. This guide shows you how to set up automatic HTTPS for your Rails application using Caddy as a reverse proxy. Step 1: Configure Local Domain Resolution Pick a localhost domain for your app. Anything that is *.localhost is resolved…

Managing your dotfiles with GNU Stow

I recently stumbled upon a little program called GNU Stow . It’s a small util that follows the unix philosophy to do one thing only and do it well. You can read the program description in their website, but long story short, it allows you to easily manage symlinks from different sources. It’s the perfect util to manage a dotfiles installation. If you use macOS with homebrew, you can install it…

Users don't care about underlying technologies

Your users don’t care about the underlying technologies that you use to build your product. They don’t care about what programming language you used. They don’t care if your website is a Single Page Application or you used Turbolinks . They don’t care if you have a micro-services oriented architecture or if you created a monolith . They don’t care if your API is in Rails or in Go. All they care…

Using MailSpyInterceptor to BCC yourself

When you’re running an early stage startup, it’s helpful to BCC yourself in every transactional email that your application sends. It might not be suited for big companies with tons of automated emails but it’s handy in this particular case. It will certainly help you to catch bugs and notice problems early on. I created the MailSpyInterceptor gem . Once installed, it will simply BCC the email(s)…

Using view helpers in Rails controllers

The other day I needed to use a view helper in my controller in order to nicely format a flash message. It turns out that it’s a simple thing to do. In my particular case, I had a helper to format a phone number using the phony gem . # app/helpers/application_helper.rb def format_phone ( phone_number ) unless phone_number . nil? Phony . formatted ( phone_number , spaces : '-' ) else '' end end…

Custom activeadmin pages

Activeadmin is such a nice tool if you want a quick admin backend (who wants to write an admin backend right?), it has a pretty simple DSL and a very decent UI. It is also a very active project under constant improvement which always is a good thing. Let me show you how to create custom activeadmin pages with nice JS charts included. I’m assuming that you have a rails application with activeadmin…

Pumas on Heroku with New Relic

Puma is a fast Ruby webserver with a very small memory footprint. However, if you try to use New Relic with Puma on Heroku, you will see that no data is recorded in New Relic. To solve that situation, you just need to setup the following Heroku config var: heroku config:add NEWRELIC_DISPATCHER=Puma And voila!, now your New Relic dashboard should be displaying all the metrics about your app.…

Using RVM in a Crontab

If you use rvm and need to run a crontab in your server, then you know that it doesn’t work out of the box. The first thing that you might try to do would be something like this: 1 0 * * * bundle exec ruby /your/awesome/script.rb However you will see all kind of error messages like Gemfile not found and similar errors. The correct way to run it, is to invoke directly your ruby installation from…

Rmagick gem and Imagemagick with Homebrew

Dependency management is hard . Some of us are still stuck with rmagick , which hasn’t been updated in years. I think that minimagick is a good replacement, but sometimes we just can’t control all our dependencies. After upgrading imagemagick via homebrew , you try to run your rails project, and you get all kind of messages telling you that your rmagick gem does not work anymore... we’ve all been…

UI fundamentals for programmers

Last Nov 24th, I participated in the Bogodev meetup and gave a talk titled "UI fundamentals for programmers" . My objective was to share my personal experiences with other developers and to have a conversation around those experiences. Since the talk was given in Spanish, I’m going to share the key parts in this post. Disclaimer I consider myself a noob in this field. The content of the talk is…