Heroku: how to create daily database backups for free

Question Can I have database backups on Heroku free plan? I have a database in the entry / free tier on Heroku. Is there any way to have automatic backups (e.g. daily backups)? Answer You don’t need a paid plain…

Git: how to rename branch master to main

Question How can I rename git branch master to main? I see that many projects are moving from master to main. What is the easiest way to rename the master branch to main? How can I rename it also on the Github repo without breaking things?…

Kubernetes: restart the pods of all deployments

Question How can I restart all pods in a Kubernetes cluster? Is there a simple command to restart all pods in a Kubernetes cluster? For example if you run a Rails migration on the database (rails db:migrate), then you need…

Convert DateTime into Date in Ruby on Rails

Question How can I transform a DateTime into a Date in Ruby on Rails? In a Ruby on Rails application I have the created_at column. Now I want to print it: However that prints something like Posted on 05 Dec 12:34, which includes…

How to create a label inside an input with HTML and CSS

Question How can I create a label inside an input? I would like to add a gray text inside an input field that disappears when the user clicks on the field and starts typing. Do I need JavaScript or I can simply…

How to remove the previous / next post links in WordPress?

Question How can I remove the previous / next post links in WordPress? WordPress automatically adds a “Previous post” link and a “Next post” link below each post. I don’t need them and I find them confusing. Is there any…

Using Google Workspace Gmail for sending emails from a Rails app

Question Can I use Google Workspace Gmail for sending emails from a Rails app? In the Rails guide for Action Mailer I see this example code for Gmail: However it doesn’t seem to work for Google Workspace (i.e. email on a custom domain). Does…

What does map(&:name) mean in Ruby?

Question What does map(&:name) mean in Ruby? In the above code, what does the &:name means? Answer The syntax &:name in Ruby is just syntactic sugar: &:name creates a block that receives an object and calls the #name method on it. Basically…

The minimal valid HTML document

Question What is the minimal valid HTML document? I usually start with a template like this: I wonder if that is the minimal HTML document or if a shorter valid HTML document exists. Answer You can easily find the minimal…