eagle in the sky at loon lodge 2008
Written by Sean Behan on 06/17/2012
A Ruby Regex for Removing Links and Images from Text
r = /https?:\/\/[\S]+/i
you_string.gsub(r, '')
Here's the rubular regex to play around with yourself http://rubular.com/r/SRKkYrW4IJ
Written by Sean Behan on 11/14/2013
How to Handle Uploading Really Large Files in PHP
PHP has some default limits that do not work out of the box when you want to work with uploading very large files.
So there are a few configuration changes you have to make to the defaults that come with PHP. These are defined in you php.ini file.
The...
Written by Sean Behan on 09/20/2018
Using Grep To Find or Match All Links in an HTML Document
egrep -or "(http(s)?://){1}[^'\"]+" path/to/directory
You can further reduce to just return the images by piping again.
grep -r src views/ | egrep -o "(mailto|ftp|http(s)?://){1}[^'\"]+"
The -r flag is for a recursive directory scan....
Written by Sean Behan on 09/15/2013
Date and Time Helpers in Rails
Just for reference http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001695
This post was created about ago
Written by Sean Behan on 06/17/2012