Roll Your Own Session Based Flash Messaging w/ Sinatra
Session based flash messages are fairly common in web apps. They work well when you have a temporary status to report back to the user, such as successfully saving a form.
If you use Rails it comes with the Framework. If you are using Sinatra there ar...
Written by Sean Behan on 11/01/2013
How to Copy and Paste to/from the Global Register with Tmux on Mac OS X
Using the system clipboard with tmux on OS X is broken. I really like tmux but having copy and paste is kind of important for me. Here is my attempt to get it back with a simple bash script until I find something better. The approach is to take a named pi...
Written by Sean Behan on 06/17/2012
Rounded Corners with CSS
.rounded_corners {
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
-khtml-border-radius: 20px;
border-radius: 20px;
}
Written by Sean Behan on 06/17/2012
Descending Sort By in Model For Active Record Hash on Created_at attribute
If you have a couple collections from the database and you want to sort it without the help of Active Record, take a look at the sort_by method on Array type. I've used this before when I have a couple of collections which are slightly different but I nee...
Written by Sean Behan on 06/17/2012
Regular Expression for finding absolute URLs
Regular Expression for finding absolute URLs in a bunch of text... like a log file.
/(http:(.*?)\s)/
Written by Sean Behan on 06/17/2012