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

Listing Files and Directories with PHP
Listing all files and directories using PHP 5. <?php $files = array(); $dir = dir("."); while(false!==($file=$dir->read())): if(($file{0}!=".") && ($file{0}!="~") && (substr($file, -3)!="LCK") && ($file!=basename($_SERVER["PHP_SELF"]))): ...
Written by Sean Behan on 06/17/2012
Uncompress A Bz2 File Using Tar Command
Uncompress a bz2 file using tar command tar --use-compress-program bzip2 -xvf your-file-to-uncompress.tar.bz2 @source http://www.kde.gr.jp/help/doc/kdebase/doc/khelpcenter/faq/HTML/bzip2.html...
Written by Sean Behan on 06/17/2012
How To Create a Dump File in Postgres Compatible with Heroku
When Heroku creates a dump file of your Postgres database it uses the `-Fc` option It is equivalent to running pg_dump -Fc -d name_of_db > name_of_db.dump This command will let you import your database with the `pg_restore` command pg_rest...
Written by Sean Behan on 03/06/2017
Select Distinct in Rails with Active Record
User.find :all, :select => "DISTINCT occupation"
Written by Sean Behan on 06/17/2012
Color Output with Test:Unit, AutoTest and Ruby 1.9
If you are testing using Test:Unit (rather than RSpec) and you're using Ruby 1.9.* colorized output of your tests using Autotest will not be immediately available. Since, 1.9 comes with mini test the test/unit/ui/console/testrunner.rb script is not loaded...
Written by Sean Behan on 06/17/2012