Hi

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

Render Partial if File Exists
If you ever want to render a partial but don't want an error thrown you can either check for the existence of the file first params[:controller]+"/sidebar" if File.exists?(RAILS_ROOT+"/app/views/"+params[:controller]+"/_sidebar.html.erb") %> or you ca...
Written by Sean Behan on 06/17/2012
Starting the Rails Console in Production Mode
To specify which mode you'd like the rails console to boot up in, just provide the string without any flags. ./script/console production ./script/console test ./script/console development If you're on windows, remember the backslash "\" rather than for...
Written by Sean Behan on 06/17/2012
a nice cup of coffee
Written by Sean Behan on 06/17/2012
How to Get a Random Item from an Array in PHP
Use this snippet for grabbing a random item from an array in php $fruits = ['apple', 'banana', 'carrot', 'date', 'elderberry']; echo array_rand(array_flip($fruits)); // => 'banana' PHP's `array_flip` makes the keys the values and the valu...
Written by Sean Behan on 11/10/2017
How To Increase or Change the File Upload Size in the PHP ini file for Wordpress
You need to find which configuration ini file has been loaded by PHP. The easiest way to do this is to run the phpinfo() function from the command line. php -r "phpinfo(); " | grep -i "loaded configuration file" You should see something like...
Written by Sean Behan on 08/24/2013