#how to
4 posts tagged how to. Clear filter
-
How to Merge a YAML File Into a Single Hash in Ruby
require 'yaml' Nested YAML structure from something-nested.yml nested: key: value keytwo: valuetwo Procedural Approach to building a single Hash from nested YAML data structure. @yaml =...
-
Rails Find All by Birthday: How to Find Upcoming Birthdays with ActiveRecord
There are a few ways to solve this problem. However, I think the easiest is to cache the day of the year that the user is born on as an integer. If stored alongside the timestamp we can quickly get...
-
Git: How to Delete a Branch with an Invalid Name
If you've named a branch beginning with two dashes "--", you're sort of in trouble because git interprets your branch name as a switch/flag. You can skip switches all together by supplying two...
-
Set Cron Job to Run Every Five Minutes for a Ruby on Rails Rake Task
First off you'll need to edit your cron file. Normally, the cron files are kept under /etc/cron.daily or /etc/cron.hourly but we can just use the command line tool, crontab and pass it the -e flag,...