How to Cast an Array to an Object with PHP
It's short and sweet.
$obj_from_array = (object)['key'=>'val'];
echo $obj_from_array->key;
Written by Sean Behan on 12/02/2017
Chunk an FLV File into Multiple Parts
The format is as follows
ffmpeg -i <input file> -ss <starting point> -t <length of capture> <output file>
ffmpeg -i Input_File.flv -ss 00:00:00 -t 00:10:00 Output_Filename.flv
http://www.surfthedream.com.au/blog/Archives/november...
Written by Sean Behan on 06/17/2012
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
Using Your Partials in Your Liquid Templates
I'm working on a project that requires users/designers be allowed to edit the layout of their site. I'm using Liquid, Ruby templating system developed by the folks at shopify.com.
Doing a little searching I found this great post http://giantrobots.though...
Written by Sean Behan on 06/17/2012
How to Install a Ruby Package without Ri or RDoc
gem install --no-rdoc --no-ri rails
Written by Sean Behan on 06/17/2012