Rails Paperclip Plugin Options for Attaching Files
I usually change some of the default settings when I use the Paperclip plugin. For most of my projects I don't like having separate directories for each image that is uploaded. I prefer, in this instance, to put avatars of different sizes together under o...
Written by Sean Behan on 06/17/2012
How to Extract the Title From an HTML Page with Ruby
This snippet will make a request to this page and extract the title from the title tag.
require 'open-uri'
html = open('http://www.seanbehan.com/how-to-extract-the-title-from-an-html-page-with-ruby').read
title = html.match(/(.*)/) { $1 }
pu...
Written by Sean Behan on 08/22/2013
SHA1 or MD5 Hashing in Python
import hashlib
print hashlib.sha1("My wonderful string").hexdigest()
print hashlib.md5("My other wonderful string").hexdigest()
Written by Sean Behan on 06/17/2012
How to Import/Export Your Wordpress Blogroll... er, Your Links
It's not immediately apparent how to import/export the links in your Wordpress blogroll. One would expect that the import/export tool, used to backup/restore Wordpress posts and pages would handle this functionality as well. But the import/export tool has...
Written by Sean Behan on 06/17/2012
How to Flush or Erase Cache of Your XCode iOS or MacOS Cocoa App
If you're working with an XCode application, either iOS or MacOS, and want to do a completely clean build and delete the cache, it's simple.
Execute this command from the command line..
defaults delete your.apps.bundle.id
Where "your.apps.bundl...
Written by Sean Behan on 06/08/2018