Connect to Postgres on Heroku using DATABASE_URL Config Var with PHP and PDO
Unfortunately PHP's PDO constructor doesn't take a database connection url (in a format that Heroku makes available as a config var) as an argument. It has its own, rather odd syntax.
However, it's easy enough to extract url parts with the `parse_url`...
Written by Sean Behan on 11/10/2017
How To Install Pyscopg2 Python Postgres Driver on Mac OSX with Homebrew, Postgres.app and VirtualEnv
You might have to append the path of the Postgres.app bin directory to your path in order to install the Python driver for Posgres.
export PATH=$PATH:/Applications/Postgres.app/Contents/MacOS/bin
To find the location of the application try this
...
Written by Sean Behan on 11/19/2013
Open Files in TextMate 2 with A Single Click
To open files with a single click from the file browser inside of TextMate 2 run this command from the terminal
defaults write com.macromates.TextMate.preview fileBrowserSingleClickToOpen -bool true
And to turn it off
defaults write com.macro...
Written by Sean Behan on 11/04/2013
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
How to Use RVM and POW with Ruby 2.0.0
In your project's root directory add a .ruby-version file and add the ruby version to the file
ruby-2.0.0-p247
Next source RVM in the .powrc file, also in your project's root directory.
source "$rvm_path/scripts/rvm"
rvm use `cat .ruby-versio...
Written by Sean Behan on 10/19/2013
How to Upgrade RVM on Mac OS X
I had an old version of rvm installed and wanted to upgrade. So old in fact that the resource for upgrading no longer existed.
rvm update
just returned a 301, redirect.
Luckily, the following worked
# checks out from repo
rvm update --head
# will re...
Written by Sean Behan on 06/17/2012
Ruby Reload! Method in Non Rails IRB Sessions
I love the Rails reload! function when in the console. I need it in Irb. To get it back this is what I did. If you don't already have an .irbrc file in your home directory, just create it.
vim ~/.irbrc
or textmate if you prefer
mate ~/.irbrc
Add this...
Written by Sean Behan on 06/17/2012
How to Copy and Paste to/from the Global Register with Tmux on Mac OS X
Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I find something better. The approach is to take a named pi...
Written by Sean Behan on 06/17/2012
Installing and Using Rvm on Mac OS X, Creating Gemsets and Reverting to Original Environment
What is RVM and why should you use it? RVM is a Ruby interpreter, version management tool. In short, it enables you to switch between different versions and releases of Ruby (for instance, version 1.8.6, 1.8.7, jruby 1.9.2, ruby enterprise edition) on the...
Written by Sean Behan on 06/17/2012
Installing Scala on Mac OS X Leopard
I followed the instructions from here http://arvinderkang.com/2009/09/01/installing-scala-on-snow-leopard/ but I used version 2.7.6 (rather than .5) I installed scala under /usr/local/scala so I had to include it to my path. Type
vim .bash_profile
expor...
Written by Sean Behan on 06/17/2012
Installing Sphinx Search Engine on Mac OS X... or ld: library not found for -lmysqlclient
If you are trying to install Sphinx on Mac OS X, it will most likely fail. The current version of MySQL bundled with Mac OS X is not supported and therefore, it will spit out the error message because it can't find the correct libraries.
ld: library no...
Written by Sean Behan on 06/17/2012
Sending eMail with Rails on Mac OS X Development Environment
You'll need a mail transport agent (MTA). I installed and used postfix using Mac Ports.
sudo port install postfix
You'll need to start postfix, to send mail from your Rails application. You can set it as a startup item and it will start on boot. However...
Written by Sean Behan on 06/17/2012
Setting up a new ubuntu server with apache2, php, ruby on rails, rubygems, mysql, and git
Here are a list of commands to get up and running with Apache2 with Phussion Passenger for Rails, PHP5, MySQL5, Ruby on Rails with Gems, and the source control software Git. I think that this is a pretty ideal environment for a development box and even pr...
Written by Sean Behan on 06/17/2012