Syntax Highlighting with Nokogiri and Pygments

I'm pretty sure anyone who codes or works with CSS has encountered syntax highlighting in some form or other; I'm equally sure that they appreciated it, too (at least the concept of it, maybe the color scheme was distasteful). It's a great way to distinguish different datatypes and different parts of code (classes, methods, operators, ...) at a glance, ease the strain of contrast between font and background colors, and of course, it makes it look pretty.

[more...]


* Tags - ruby-on-rails gem
* Category - Code

* Comments - #<Entry:0x0000000683a2b0>

* Tue, Sep 18, 2012 @ 8:10 PM CDT

Add Markdown To A Rails 3.2 App

Have a text area in part of your app that you'd like to have marked up for you without having to write that dreadful markup yourself? That's what I wanted with this blog. Since my entries may be somewhat long and include code examples, images (though none have yet to be seen), hyperlinks and other useful bits of information it would become quite tedious to write everything with HTML or even HAML. My choice was to use Markdown, specifically, the Github flavor. This is a visual approach to marking up text, or rather it's a visual approach that is parsed into HTML for you, and is mighty handy.

[more...]


* Tags - ruby-on-rails gems
* Category - Code

* Comments - #<Entry:0x00000006839c98>

* Mon, Aug 27, 2012 @ 4:10 PM CDT

How To Create An 'excerpt' Method For A Rails Project

It's not an easy (or fun) choice when building your own blog to seemingly have only two options for displaying your entries, all or none. I've seen index pages that only display each entry's title as a link to the actual entry, where they then display the whole of it. I'm not a writer and coming up with an entry title that's concise and informative of the entire entry is very difficult to do. The answer: an excerpt. I believe it's more visually and user friendly to have a preview of your entry on the index page, that way you have the ability to write descriptive preview of what's in-store for that entry, as well as have some nice content displayed besides just the meta-info of each one; such as this excerpt here :)

[more...]


* Tags - ruby-on-rails
* Category - Code

* Comments - #<Entry:0x00000006839680>

* Mon, Aug 27, 2012 @ 4:10 PM CDT

Mac OS Stickies

If you work on a Mac and don't use them already: Do it. 'Nuff said.


* Tags - productivity mac
* Category - Misc

* Comments - #<Entry:0x00000006839068>

* Mon, Aug 27, 2012 @ 4:10 PM CDT

Adding Pagination with will_paginate

Pagination helps make things nice and user friendly. No body wants to scroll through hundreds of posts (or in this case entries) to get to the footer, or at least no body that I know. Luckily the gem will_paginate helps us do this with minimal effort.

[more...]


* Tags - ruby-on-rails gems
* Category - Code

* Comments - #<Entry:0x00000006838a50>

* Mon, Aug 27, 2012 @ 4:10 PM CDT