all repos — h3rald @ 285bf352b0e02484b3d1613541aacf803dfc5df5

The sources of https://h3rald.com

Added support for popular articles on the front page.
h3rald h3rald@h3rald.com
Thu, 16 Sep 2010 17:28:21 +0200
commit

285bf352b0e02484b3d1613541aacf803dfc5df5

parent

2dffc947117bcf2f99ce14009fa0f2ecc3ef93a8

M content/articles/10-programming-languages.textilecontent/articles/10-programming-languages.textile

@@ -5,6 +5,7 @@ permalink: 10-programming-languages

filters_pre: - redcloth title: 10 programming languages worth checking out +subtitle: A quick comparison of 10 non-mainstream programming languages comments: - :date: :author: Nikhil

@@ -309,10 +310,15 @@ tags:

- programming type: article toc: true +intro: | + If you program for fun or profit, chances are that you know C, C++, Java, PHP, Perl, Python or Ruby. These programming languages are all widely known, and, to a different degree, used in commercial applications. At least some of them can safely be considered _mainstream_, even if that word has become so overused and misused that has almost lost its original meaning, if it ever had one. + +extended_intro: | + If you are earning your living by coding, it's often one of these languages that pays the bills. Nevertheless, true hackers frequently meander in other directions, exploring and discovering different paradigms and methodologies, sometimes to the most "esoteric":http://esolangs.org/wiki/Main_Page extremes. ----- If you program for fun or profit, chances are that you know C, C++, Java, PHP, Perl, Python or Ruby. These programming languages are all widely known, and, to a different degree, used in commercial applications. At least some of them can safely be considered _mainstream_, even if that word has become so overused and misused that has almost lost its original meaning, if it ever had one. -If you are earning your living by coding, it's often one of these languages that pays the bills. Nevertheless, true hackers frequently meander in other directions, exploring and discovering different paradigms and methodologies, sometimes to the most ["esoteric":http://esolangs.org/wiki/Main_Page] extremes. +If you are earning your living by coding, it's often one of these languages that pays the bills. Nevertheless, true hackers frequently meander in other directions, exploring and discovering different paradigms and methodologies, sometimes to the most "esoteric":http://esolangs.org/wiki/Main_Page extremes. bq. "The most obvious common 'personality' characteristics of hackers are high intelligence, consuming curiosity, and facility with intellectual abstractions. Also, most hackers are 'neophiles', stimulated by and appreciative of novelty (especially intellectual novelty). Most are also relatively individualistic and anti-conformist."
M content/articles/10-reasons-to-learn-ruby.textilecontent/articles/10-reasons-to-learn-ruby.textile

@@ -1,11 +1,11 @@

----- -summary: "Ten possible reasons to learn the Ruby Programming Language. Mostly related to the language's syntax and most useful idioms." +subtitle: "Ten possible reasons to learn the Ruby Programming Language" popular: true permalink: 10-reasons-to-learn-ruby filters_pre: - erb - redcloth -title: 10 Reasons to Learn Ruby +title: "10 Reasons to Learn Ruby" comments: - :date: 2007-09-05 17:33:43 +02:00 :author: Joel Moss

@@ -309,6 +309,10 @@ tags:

- ruby type: article toc: true +intro: | + I discovered Ruby fairly recently, through the excellent Ruby on Rails framework. Although I don't consider myself a Ruby expert by any means, I read the PickAxe[2], I've coded a few utilities for my personal use in Ruby and I'm currently developing with Rails during my free time. +extended_intro: | + Ruby is currently my programming language of choice; I started off with Turbo Pascal in high school, discovered C and C++ at university, did my thesis in Java and learned PHP from scratch because I wanted to learn how to make websites quickly and easily. I guess I feel compelled to code sometimes, more as a form of entertainment than anything else. Rather dissatisfied with what I tried language-wise, I was determined to start learning either Python or Ruby. I chose the latter because I didn't want incorrect indentation to break my code, and here I am, heaping praise upon it. ----- h3. Preamble
M content/articles/firefox-lovers-guide-to-opera.textilecontent/articles/firefox-lovers-guide-to-opera.textile

@@ -1,5 +1,5 @@

----- -summary: "An in-depth review of the Opera browser, with the eyes of a Firefox enthusiast. A useful comparison of the two browsers, whether you're planning to _switch_ or not." +subtitle: "An in-depth review of the Opera browser, with the eyes of a Firefox enthusiast" popular: true permalink: firefox-lovers-guide-to-opera filters_pre:

@@ -223,6 +223,10 @@ - opera

- firefox type: article toc: true +intro: | + I am a Firefox fan. I've been using Firefox since it was named "Firebird" and calling it "stable" was a big overstatement. Firefox dragged me out of Internet Explorer, and that was definitely one of its biggest achievements. + + Because I'm addicted to trying out new tools, however, I always kept testing new browsers I discovered here and there. K-Meleon, Flock, Sleipnir... When Safari came out for Windows I immediately installed it and used it for about 2 hours, only to realize that it wasn't – and it still isn't – usable at all, mainly due to sporadic crashes. ----- bq. *Note:* This article can be considered a sequel for "An IE Lover's Guide to Firefox":http://www.h3rald.com/articles/ie-lovers-guide-to-firefox, which described Firefox through the eyes of an Internet Explorer fan. Similarly, this article describes Opera's features from the point of view of a user – myself – who has been using Firefox for years and is now considering another browser switch.
M content/articles/herald-vim-color-scheme.textilecontent/articles/herald-vim-color-scheme.textile

@@ -1,5 +1,5 @@

----- -summary: "My very own VIM color scheme. Featuring 256, 16 and 8 color support, high readability and... pretty colors!" +subtitle: "My very own VIM color scheme. Featuring 256, 16 and 8 color support, high readability and... pretty colors!" permalink: herald-vim-color-scheme filters_pre: - redcloth

@@ -74,8 +74,17 @@ - vim

type: article toc: true popular: true +intro: | + I use "Vim":http://www.vim.org a lot. It's my editor of choice when I code (mainly in Ruby), and also when I write my blog post and articles (mainly in Textile). + + One thing I always liked about Vim was it powerful syntax highlighting: there's probably a syntax highlighting file for every programming language ever created, even the new ones ("Nimrod":http://force7.de/nimrod/index.html? Sure, "here":http://www.vim.org/scripts/script.php?script_id=2632!). +extended_intro: | + Furthermore, Vim allows you to create color schemes, and that's surprisingly easy to do. Everything you need to do is in the "docs":http://vimdoc.sourceforge.net/htmldoc/syntax.html, but that may put you off, so you can just start by editing an existing one -- that's what I did.h3. InfiniteRed Black + + I've been using the "ir_black":http://blog.infinitered.com/entries/show/8 color scheme for near enough a year. It's an excellent color scheme, recommended especially for writing Ruby code: ----- I use "Vim":http://www.vim.org a lot. It's my editor of choice when I code (mainly in Ruby), and also when I write my blog post and articles (mainly in Textile). + One thing I always liked about Vim was it powerful syntax highlighting: there's probably a syntax highlighting file for every programming language ever created, even the new ones ("Nimrod":http://force7.de/nimrod/index.html? Sure, "here":http://www.vim.org/scripts/script.php?script_id=2632!). Furthermore, Vim allows you to create color schemes, and that's surprisingly easy to do. Everything you need to do is in the "docs":http://vimdoc.sourceforge.net/htmldoc/syntax.html, but that may put you off, so you can just start by editing an existing one -- that's what I did.h3. InfiniteRed Black
M content/articles/komodo-edit-review.textilecontent/articles/komodo-edit-review.textile

@@ -1,6 +1,5 @@

----- -summary: "A comprehensive review of the free editor from ActiveState, and why it's a very interesting alternative to more complex and heavy IDEs." -popular: true +subtitle: "A comprehensive review of the free editor from ActiveState" permalink: komodo-edit-review filters_pre: - redcloth

@@ -108,6 +107,12 @@ - programming

- software type: article toc: true +intro: | + _What's your favorite code editor?_ + + This is a common question which still keeps popping up on community boards, mailing lists, comments, etc. Every programmer who writes code in some programming language normally has an editor of choice. Being realistic, most of the times it's not only one program but several, depending on the language and on the features needed at the time. + + Yes, great, but how do you choose your favorite editor? ----- <a href="http://digg.com/programming/A_closer_look_at_Komodo_Edit"> <img src="http://digg.com/img/badges/180x35-digg-button.png" width="180" height="35" alt="Digg!" />
M content/articles/rails-inspired-php-frameworks.textilecontent/articles/rails-inspired-php-frameworks.textile

@@ -1,5 +1,5 @@

----- -summary: "A roundup of six different PHP frameworks inspired by Ruby on Rails. Each with essential details, comments, pros and cons." +subtitle: "A roundup of six different PHP frameworks inspired by Ruby on Rails" popular: true permalink: rails-inspired-php-frameworks filters_pre:

@@ -77,6 +77,7 @@ - cakephp

- rails type: article toc: true +intro: There are various articles online examining many PHP frameworks, providing short reviews or comparative charts, but I could not find yet an article examining the so called _"Rails-inspired frameworks"_ anywhere on the web, so I decided to write my own... ----- There are various articles online examining many PHP frameworks, providing short reviews or comparative charts, but I could not find yet an article examining the so called _"Rails-inspired frameworks"_ anywhere on the web, so I decided to write my own...
M content/home.erbcontent/home.erb

@@ -89,20 +89,7 @@ <%= render 'article_intro', :item => latest[4], :classes => "hyphenate", :extended => false %>

</section><!-- #main-content-right end --> </section><!-- #main-content end --> <section class="right" id="secondary-content"> - <article id="popular-1"> - <header> - <h1><a href="#">10 programming languages worth checking out</a></h1> - <h2>A quick comparison of 10 non-mainstream programming languages</h2> - <p class="pubdate"><time>September 4th 2010</time></p> - <p class="author">By <em>Fabio Cevasco</em></p> - </header> - <section class="two-columns hyphenate"> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> - </section> - </article> + <%= render 'article_intro', :item => popular[0], :classes => "two-columns hyphenate", :extended => true %> <article class="feature"> <header> <p>FEATURED CONTENT</p>

@@ -116,31 +103,11 @@ <p>Glyph enables you to minimize text duplication, focus on content rather than presentation, manage references seamlessly and automate tedious tasks through a simple but effective macro language, specifically geared towards customization and extensibility.</p>

</section> </article> <section class="left border-right" id="secondary-content-left"> - <article id="popular-2"> - <header> - <h1><a href="#">Herald (Vim Color Scheme)</a></h1> - <h2>My very own VIM color scheme. Featuring 256, 16 and 8 color support, high readability and... pretty colors!</h2> - <p class="pubdate"><time>September 4th 2010</time></p> - <p class="author">By <em>Fabio Cevasco</em></p> - </header> - <section class="hyphenate"> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> - </section> - </article> + <%= render 'article_intro', :item => popular[1], :classes => "hyphenate", :extended => false %> + <%= render 'article_intro', :item => popular[3], :classes => "hyphenate", :extended => false %> </section><!-- #secondary-content-left end --> <section class="right" id="secondary-content-right"> - <article class="right popular3"> - <header> - <h1><a href="#">A closer look at Komodo Edit</a></h1> - <h2>A comprehensive review of the free editor from ActiveState</h2> - <p class="pubdate"><time>September 4th 2010</time></p> - <p class="author">By <em>Fabio Cevasco</em></p> - </header> - <section class="hyphenate"> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p> - <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p> - </section> - </article> + <%= render 'article_intro', :item => popular[2], :classes => "hyphenate", :extended => false %> + <%= render 'article_intro', :item => popular[4], :classes => "hyphenate", :extended => false %> </section><!-- #secondary-content-right end --> </section><!-- #secondary-content-end -->
M content/links.textilecontent/links.textile

@@ -9,8 +9,13 @@

You can't really ask or pay to be on this page, what you _can_ do is make your site interesting enough that I'll feel obliged to list it here. I don't really visit any of these web sites often, I normally read their feeds regularly in "Google Reader":http://www.google.com/reader, so they are categorized according to the Google Reader folders I use. <script type="text/javascript" src="http://www.google.com/reader/ui/publisher-en.js"></script> -<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/14176324761214556276/label/Blogs?callback=GRC_p(%7Bc%3A%22-%22%2Ct%3A%22Blogs%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> -<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/14176324761214556276/label/News?callback=GRC_p(%7Bc%3A%22-%22%2Ct%3A%22News%20Sites%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> -<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/14176324761214556276/label/Programming?callback=GRC_p(%7Bc%3A%22-%22%2Ct%3A%22Programming%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> -<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/14176324761214556276/label/Ruby?callback=GRC_p(%7Bc%3A%22-%22%2Ct%3A%22Ruby%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> -<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/14176324761214556276/label/Software?callback=GRC_p(%7Bc%3A%22-%22%2Ct%3A%22Software%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> +<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/17885544216336877607/label/Blogs?callback=GRC_p(%7Bc%3A%22blue%22%2Ct%3A%22Blogs%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> +<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/17885544216336877607/label/News?callback=GRC_p(%7Bc%3A%22blue%22%2Ct%3A%22News%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> +<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/17885544216336877607/label/Comics?callback=GRC_p(%7Bc%3A%22blue%22%2Ct%3A%22Comics%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> +<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/17885544216336877607/label/Programming?callback=GRC_p(%7Bc%3A%22blue%22%2Ct%3A%22Programming%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> +<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/17885544216336877607/label/Ruby?callback=GRC_p(%7Bc%3A%22blue%22%2Ct%3A%22Ruby%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> +<script type="text/javascript" src="http://www.google.com/reader/public/javascript-sub/user/17885544216336877607/label/Software?callback=GRC_p(%7Bc%3A%22blue%22%2Ct%3A%22Software%22%2Cb%3A%22true%22%7D)%3Bnew%20GRC"></script> + + + +
M layouts/article_intro.erblayouts/article_intro.erb

@@ -3,7 +3,7 @@ filter: erb

----- <% author = @item[:author] || "Fabio Cevasco" - intro = @extended ? @item[:intro]+"\n\n"+@item[:extended_intro] : @item[:intro] + intro = @extended ? @item[:intro].to_s+"\n\n"+@item[:extended_intro].to_s : @item[:intro] %><article id="a_<%= @item[:permalink] %>"> <header> <h1><a href="<%= @item.identifier %>"><%= @item[:title]%></a></h1>

@@ -14,7 +14,7 @@ <p class="pubdate"><time datetime="<%= @item[:date].strftime("%Y-%d-%d") %>" pubdate="pubdate"><%= @item[:date].strftime("%A, %B %d %Y") %></time></p>

<p class="author">By <em><%= author %></em></p> </header> <section class="<%= @classes %>"> - <%= RedCloth.new(intro).to_html %> + <%= RedCloth.new(intro.to_s).to_html %> <p><a class="more" href="<%= @item.identifier%>">&raquo;&nbsp;<strong>Read More</strong></a></p> </section> </article>