Scope Routes/URLs By Username (like Twitter) in Your Rails Application
There are a few things that need to be taken care of before you can get this to work. The first thing (although, any of the following steps can be done in any order) to take care of involves your User model. You need to override the to_param method, so th...
Written by Sean Behan on 06/17/2012
mysql on rails 2.3.2
mysql driver is no longer bundled w/ rails. you'll need to install it yourself w/
sudo gem install mysql
however, on ubuntu (heron) this won't work. issue these commands first
sudo apt-get install libmysql-ruby libmysqlclient-dev
if libmysqlclient-dev...
Written by Sean Behan on 06/17/2012
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
How to Slugify a String in PHP
Here is a snippet for generating a URL friendly slug in PHP
function slugify($string){
return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $string), '-'));
}
And you can use it in your code like so
...
Written by Sean Behan on 10/26/2017
rails fixtures: using the right timestamp
Fixtures in Rails allow you to quickly and easily populate a database with sample data. They are great when testing your app and you need to test against a condition that will rely on a certain preexisting data point.
Fixtures are located in your RAILS_R...
Written by Sean Behan on 06/17/2012