Tomorrow I will attempt to write this in the ActiveRecord ORM, but for today’s tip here is a by-the-minute report in MySQL. select FROM_UNIXTIME( CEILING(UNIX_TIMESTAMP(`created_at`)/60)*60 ) AS times , COUNT(*) AS count from user where `registration` = ‘completed’ and `created_at` >= ‘2013-06-20’ and `created_at` < ‘2013-06-21’ group by times; This returns a list of rows with a time:count of your data. :)

Using interpolated YML and a little logic you can clean up your Rails Database.yml file. The default Rails Database.yml file. # SQLite version 3.x # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem ‘sqlite3’ development: adapter: mysql2 database: appname_development username: root pool: 5 timeout: 5000   # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 database: appname_test username: root pool: 5 timeout: 5000 Here is a cleaner version login: &login username: root password:   defaults: &defaults pool: 2 wait_time: 5 reconnect: true encoding:[…]

Note: These are not all for the command line. There are so many other tricks we learn along the way and they are seldom documented. If you know others please throw them in the comments. MySQL Tip: When you run a normal query in MySQL prompt, if your table is larger than your monitor, you get a jumbled mess of data. It is incredibly hard to read and makes for slow going. The following command replaces the common “;” with a “\G” to complete your command and displays the data in a clean vertical fashion. mysql> select * from stores where id = 1\G *************************** 1. row *************************** id: 1 company_id: 3 name: Cool Hunting verified: 0 customer_service_number: (310) 698-3333[…]