Prev PageNext Page
oh russian text, i thought you had something valuable to share...
but no, you were only clever enough to use your native tongue in an attempt to fool me into publishing your funny, spam comment! thanks to google.com/translate, you were foiled in your plot to usurp traffic from my site
Written by Sean Behan on 06/17/2012
Launch Photoshop (Or Any App) From The Command Line on Mac OS X
I often find myself coding with the terminal open. Cding around a web app project I usually end up at some point launching Photoshop. Either to touch up or work on a psd, png, jpg ...etc. I fire up Photoshop and then navigate to the app's public directory...
Written by Sean Behan on 06/17/2012
Programmatically Turn Off Comments in Wordpress with Filter
To turn comments off programmatically with a filter in Wordpress, you can set the post object's comment_status variable to "closed". Call the filter at some point after the post is loaded but before the comments are rendered. This is a hack, but I haven't...
Written by Sean Behan on 06/17/2012
Intercepting the Wordpress Loop with Pre_get_posts
#deprecated (see http://codex.wordpress.org/Function_Reference/query_posts#Post_.26_Page_Parameters) Using the "pre_get_posts" filter you can intercept the Wordpress loop and override or set attributes in the "$query" object. This is useful because you c...
Written by Sean Behan on 06/17/2012
Thematic Function Reference
I could not find a listing of all thematic theme functions for Wordpress online. So the following is just a recursive grep of the thematic directory. grep -rh "function thematic_" * Each function needs to prepended with "thematic_" when adding as a actio...
Written by Sean Behan on 06/17/2012
Very Simple Breadcrumb Navigation in Rails with Before_filter
This may not be the ideal solution. This just manages request.referers in a session variable, then looping over each unique path prints a link to the screen. It's more of a "history" than a hierarchy for resources in an application. It is however, pretty ...
Written by Sean Behan on 06/17/2012
Yield a Block within Rails Helper Method with Multiple Content_tags Using Concat
To clean up some repetitive html coding in views, pass a block of text to a helper function which will wrap it for you the same way, each and every time. For example, I have a 'help' link which will toggle the display of a block of text if a link is click...
Written by Sean Behan on 06/17/2012
Nesting Resources in Rails Routes.Rb with Namespaces
When I have a controller that takes more than one has_many argument, I think about creating a namespace. This way I may still use my forums, pages controllers w/out needing any conditional logic, testing for the presence of :course_id in the params hash. ...
Written by Sean Behan on 06/17/2012
Rake DB Everything, Dump, Destroy, Create, Load
I'm a big fan of the yaml_db plugin. But I don't like running rake db:data:load, only to find that my db columns mismatch my model attributes, thus aborting the data import task. To quickly add/remove columns/attributes from a model and rebuild the datab...
Written by Sean Behan on 06/17/2012
Carrier Email Addresses for Sending SMS over Email
Just for reference, here are the carrier email addresses for sending email as an SMS. Look up the carrier for the phone in question, then send an email in this format [telephonenumber]@[carrier-name.com] Carrier Email to SMS Gateway Alltel [10-digit p...
Written by Sean Behan on 06/17/2012
Prev PageNext Page