start new:
tmux
start new with session name:
tmux new -s myname
| browser = request.user_agent.browser | |
| version = request.user_agent.version and int(request.user_agent.version.split('.')[0]) | |
| platform = request.user_agent.platform | |
| uas = request.user_agent.string | |
| if browser and version: | |
| if (browser == 'msie' and version < 9) \ | |
| or (browser == 'firefox' and version < 4) \ | |
| or (platform == 'android' and browser == 'safari' and version < 534) \ | |
| or (platform == 'iphone' and browser == 'safari' and version < 7000) \ |
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
As configured in my dotfiles.
start new:
tmux
start new with session name:
This gist assumes:
By default, Rails applications build URLs based on the primary key -- the id column from the database. Imagine we have a Person model and associated controller. We have a person record for Bob Martin that has id number 6. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6 here, is called the "slug". Let's look at a few ways to implement better slugs.