How to Import/Export a Database from One Heroku App to Another Heroku App
Heroku is awesome! Let's say we want to copy a production database to a staging database.
We can use the `pg:backups:restore` command to accomplish this. Here is an example. For the source database we are using the `production-app-name` and for stagi...
Written by Sean Behan on 03/07/2017
Sample Rails Database Config for MySQL
Sample Ruby on Rails database config file for connecting to mysql.
production:
adapter: mysql
encoding: utf8
reconnect: false
database: db_production
pool: 5
username: db_user
password: db_password
#socket: /tmp/mysql.sock #this may vary
...
Written by Sean Behan on 06/17/2012
Generate a Gravatar URL with Ruby
To get a Gravatar you need to hash an email address with the MD5 algorithm.
MD5 is a part of the Ruby standard library. Rails loads it by default, but otherwise you will have to require it yourself.
This is a simple implementation.
Gravatar su...
Written by Sean Behan on 04/11/2014
How to Filter or Search HTML with Vanilla Javascript - No JQuery Required
The basic approach is to use the `document.querySelectorAll` to match certain elements, then manually set the display property to 'none' or 'block' (or 'inline-block') to hide or show it. Using the `match` method allows us to detect whether or not the sea...
Written by Sean Behan on 01/30/2018
How to Flush or Erase Cache of Your XCode iOS or MacOS Cocoa App
If you're working with an XCode application, either iOS or MacOS, and want to do a completely clean build and delete the cache, it's simple.
Execute this command from the command line..
defaults delete your.apps.bundle.id
Where "your.apps.bundl...
Written by Sean Behan on 06/08/2018