I'm Sean.

I write about #software, #SaaS, #consulting and #mobile app development

I code in #Python, #PHP, #Swift, #Ruby, #ReactJS and #Postgres

Random Blog Posts See more posts

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 a list but properly handle the full birthday elsewhere, s...
Written by Sean Behan on 06/17/2012
Ruby strftime() method arguments
Just for reference strftime() arguments in ruby. Usage `Time.now.strftime("%B/%d/%Y")` %a weekday name. %A weekday name (full). %b month name. %B month name (full). %c date and time (locale) %d day of month [01,31]. %H hour [00,...
Written by Sean Behan on 03/05/2017
How to Fix Line Wrap Bug in iPython Terminal on OS X Mavericks
There is annoying line wrap issue present after installing iPython on OS X Mavericks for the first time. The issue has to do with readline being missing. To fix the problem uninstall iPython, install readline and then install iPython. pip uninstall ip...
Written by Sean Behan on 10/26/2013
Using to_sentence method on an Array in Ruby on Rails
Member.all.collect {|member| member.firstname}.to_sentence => "Alex, Andy, and Sean" Declare separator and the connector Member.all.collect {|member| member.firstname}.to_sentence( :connector => "and last but not least,", :skip_last_comma => tr...
Written by Sean Behan on 06/17/2012
How to Make Cross Database Queries with Postgres and DBLink Extension
Here are a few snippets for cross database queries. It's important to note that you must be explicit in enumerating the columns and types you are querying. Otherwise, things will probably not work as expected. -- enable extension create extension db...
Written by Sean Behan on 03/18/2017