all repos — h3rald @ 694b0113a7f14063972a6d7bccf4ab2d1cb248e5

The sources of https://h3rald.com

Added filter detection + syntax highlighting.
h3rald h3rald@h3rald.com
Sat, 08 Aug 2009 22:51:35 +0200
commit

694b0113a7f14063972a6d7bccf4ab2d1cb248e5

parent

5f9db851787c83b97da248096870ae98da2f2f09

147 files changed, 750 insertions(+), 330 deletions(-)

jump to
M README.textileREADME.textile

@@ -1,9 +1,13 @@

h2. Dependencies -The following ruby gems are required to compile the site: -* nanoc -* extlib +h3. Ruby Gems -Additionally, the following gems are required to execute db:migration tasks: -* mysql -* sequel +* nanoc (generate static site) +* extlib (Rake tasks) +* mysql (Typo migration) +* sequel (Typo migration) +* bb-ruby (BBCode filter) + +h3. Other + +* pygments (code highlighting)
D content/.textile

@@ -1,30 +0,0 @@

------ -title: herald.vim -tags: [] -filters_pre: [textile] ------ -h2. herald.vim - -*herald* is a dark color scheme for "Vim":http://www.vim.org which aims to be easy to read, eye-appealing, portable on multiple terminals, and suitable for source code highlighting in multiple languages. - -You can get the latest version *"HERE":/files/herald.vim* (direct link). - -h3. Changelog - -* *v0.2.0* -** Support for 8 and 16 color modes -** Fixed completion menu colors -** Improved readability for Visual mode -** Specified highlighting for all the most common Vim syntax groups -* *v0.1.0* -** Initial Release - -h3. Screenshot - -!/images/herald.vim/herald_vim.png! - -h3. Resources - -* "Original Announcement":http://www.h3rald.com/articles/herald-vim-color-scheme -* "Script Page":http://www.vim.org/scripts/script.php?script_id=2684 [on Vim.org] -* "File History":http://github.com/h3rald/stash/commits/master/.vim/colors/herald.vim [on GitHub]
M content/404.textilecontent/404.textile

@@ -1,10 +1,12 @@

----- permalink: "404" +filters_pre: +- redcloth title: Page Not Found +date: 2008-10-26 11:34:54 +01:00 tags: [] type: page -filter_pre: textile ----- h2. Page Not Found
M content/about.textilecontent/about.textile

@@ -1,10 +1,12 @@

----- permalink: about +filters_pre: +- redcloth title: About +date: tags: [] type: page -filter_pre: textile ----- h2. About this Web Site
M content/articles/10-programming-languages.textilecontent/articles/10-programming-languages.textile

@@ -1,10 +1,12 @@

----- permalink: 10-programming-languages +filters_pre: +- redcloth title: 10 programming languages worth checking out +date: 2008-12-21 15:01:15 +01:00 tags: - programming type: article -filter_pre: textile ----- 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.
M content/articles/10-reasons-to-learn-ruby.textilecontent/articles/10-reasons-to-learn-ruby.textile

@@ -1,10 +1,13 @@

----- permalink: 10-reasons-to-learn-ruby +filters_pre: +- erb +- redcloth title: 10 Reasons to Learn Ruby +date: 2007-09-05 12:40:00 +02:00 tags: - ruby type: article -filter_pre: textile ----- h3. Preamble

@@ -58,19 +61,19 @@ _- "No, silly, they are numbers!"_

In Ruby, numbers, strings, Boolean values _et al_ are objects. Really. This means you'll write things like: -<typo:code lang="ruby"> +<% highlight :ruby do %> "YOU SHOULDN'T ALWAYS USE CAPITALS".downcase #=> outputs "you shouldn't always use capitals" -12.abs #=> outputs 12 -</typo:code> +<% end %> instead of something like: -<typo:code lang="ruby"> +<% highlight :ruby do %> # PHP Code strtolower("YOU SHOULDN'T ALWAYS USE CAPITALS"); abs(-12); -</typo:code> +<% end %> You save time, you save brackets, and it just makes more sense.

@@ -88,19 +91,19 @@ * You give up, and you just create the method outside the class, somewhere else. This can be done, but it is not very elegant and goes against Object Oriented Programming.

In Ruby, you can simply add the method to the original class, without having to hack the original source code, and even for system classes! You want to have a method to automatically convert a measurement from meters to feet? You can simply extend the Numeric class as follows: -<typo:code lang="ruby"> +<% highlight :ruby do %> class Numeric def feet self*3.2808399 end end -</typo:code> +<% end %> From now on, all your numbers will have a _feet_ method, which can be used just like any other method that was originally defined for the class: -<typo:code lang="ruby"> +<% highlight :ruby do %> 5.feet #=> Returns 16.4041995 -</typo:code> +<% end %> Basically, Ruby classes are never closed and can be modified at any time from anywhere. Use with care, of course.

@@ -113,19 +116,19 @@ h4. #8 You don't really need XML

XML is a nice, general-purpose markup language which can be processed by every programming language and used everywhere. Unfortunately, it can also be quite verbose to write, very difficult to parse, and let's be honest, it's not really readable at first glance in many cases, unlike the following code snippet: -<typo:code lang="yaml"> +<% highlight :yaml do %> regexp: !ruby/regexp /a-zA-Z/ number: 4.7 string: a string -</typo:code> +<% end %> This is definitely easier and more readable than XML, isn't it? Welcome to YAML, Ruby's favorite markup (but not really[6]) language, which can be used to represent any Ruby object in a simple, clear and yet complete way. Ruby _can_ parse XML, but YAML's simplicity convinced a lot of developers to use it as an alternative to XML for configuration files, for example (Rails does this). The code snipped presented before was obtained by executing the following line of Ruby code: -<typo:code lang="ruby"> +<% highlight :ruby do %> {"string" => "a string", "number" => 4.7, "regexp" => /a-zA-Z/}.to_yaml -</typo:code> +<% end %> The _to_yaml_ method is defined for the Object class, which is the father of all of the other classes, and thus it is available in all Ruby objects. This means that you can convert anything into YAML _and_ re-convert anything back into Ruby objects, with total transparency for the developer. So much for parsing, huh?

@@ -133,7 +136,7 @@ h4. #9 Lambda is much more than a Greek letter

Ruby borrows some magic from Lisp and Perl with Proc objects and blocks. Procs are _"blocks of code that have been bound to a set of local variables. Once bound, the code may be called in different contexts and still access those variables." _[7] Consider the following: -<typo:code lang="ruby"> +<% highlight :ruby do %> def gen_times(factor) return Proc.new {|n| n*factor } end

@@ -144,15 +147,15 @@

times3.call(12) #=> 36 times5.call(5) #=> 25 times3.call(times5.call(4)) #=> 60 -</typo:code> +<% end %> I could have used the _lambda_ method instead of _Proc.new_ and gotten the same result. This should ring a bell for people who know Perl and Python (or Lisp)[8]. You can do the same thing in PHP as well, but most people don't really use the function.[9] Additionally, Ruby makes extensive use of blocks, sort of "unborn Procs"[10], for example, to iterate the contents of an object and execute some code, like the _each_ method available for the Array class: -<typo:code lang="ruby"> +<% highlight :ruby do %> [1, 2, 4, 6, 8].each {|c| puts c*2} #=> outputs each element multiplied by 2 in a new line. -</typo:code> +<% end %> Should the code in the block exceed one line, you're advised (but not required) to include the block within _do ... end_ instead of using braces. Ruby folks don't like braces much, really.
M content/articles/10-reasons-why-i-didnt-update-my-blog.textilecontent/articles/10-reasons-why-i-didnt-update-my-blog.textile

@@ -1,10 +1,12 @@

----- permalink: 10-reasons-why-i-didnt-update-my-blog +filters_pre: +- redcloth title: 10 reasons why I didn't update my blog +date: 2008-06-12 03:30:00 +02:00 tags: - internet rant personal writing type: article -filter_pre: textile ----- _"It has been a while since my last post, sorry about that"_ I read this sentence (or something along those lines) on many blogs on the Internet, including mine. As a matter of fact, I actually didn't write a meaningful post on my blog for a long time and no, probably this is not going to change that either.
M content/articles/10.textilecontent/articles/10.textile

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

----- permalink: "10" +filters_pre: +- redcloth title: Italian General Elections - 2006 +date: 2006-04-09 07:33:00 +02:00 tags: - italy - politics type: article -filter_pre: textile ----- !>http://www.berluscastop.it/v_imag/sodom1.gif!
M content/articles/11-07-2009.textilecontent/articles/11-07-2009.textile

@@ -1,10 +1,12 @@

----- permalink: 11-07-2009 +filters_pre: +- redcloth title: 11th of July 2009 +date: 2009-07-26 12:54:00 +02:00 tags: - wedding type: article -filter_pre: textile ----- * "Prologue":#prologue * "The wedding party":#party
M content/articles/11.textilecontent/articles/11.textile

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

----- permalink: "11" +filters_pre: +- redcloth title: Meet some Cake(PHP) bakers! +date: 2006-04-11 17:03:00 +02:00 tags: - cakephp - blogging type: article -filter_pre: textile ----- I should write more. I noticed that I since I decided to take a break from "zZine Magazine":http:www.zzine.org I more or less stopped writing - and started _baking_ again with "CakePHP":http://www.cakephp.org/. As a result I finally recoded this website and _refreshed_ a little bit my almost-rusty baking skills.
M content/articles/12.textilecontent/articles/12.textile

@@ -1,10 +1,12 @@

----- permalink: "12" +filters_pre: +- redcloth title: Choosing the right IT job +date: 2006-04-13 13:47:08 +02:00 tags: [] type: article -filter_pre: textile ----- The time has come. The times when I used to meander around reading stuff on the Net and writing about whatever I wanted are over. Incidentally, the world may end, _your_ laptop could explode and I could knock at your door in a few minutes asking for money, imagine that! Nothing of the above, alright, bad joke, but sooner or later the time to _start doing something_ comes, at some point you ought to start making some real money. It's time to settle down, my fiance&eacute; are eager to get our own independence, move to our new house (which we're still doing up) etc. etc. Fair enough. I spent the last five months wasting my time looking for a job, a _proper_ job having something to do with IT(Information Technology) and finally something seems to be possible.
M content/articles/13.textilecontent/articles/13.textile

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

----- permalink: "13" +filters_pre: +- redcloth title: Baking a new CakeArticle +date: 2006-04-13 16:21:00 +02:00 tags: - cakephp - writing type: article -filter_pre: textile ----- Too right. Enough being a lazy writer, it's time to seriously produce something. I could sit here and pretend that long blog posts can make up for the lack of new articles, but I'd like to write something _proper_ and new. Judging by the latest stats people come here hoping to find either a blog _entirely_ devoted to CakePHP or some CakePHP related content. Well, actually they can "find":http://base--/tags/CakePHP/ quite a bit, but I'd like to be able to sport more Cake-related articles, bookmarks, and posts. My main problem is that I could add ten bookmarks about Cake right away, but the _latest addition_ showed on the front page would feature only bookmarks, which would be bad (yes, I do worry about silly things). At the moment this blog is the second easiest way to provide fresh content frequently enough to encourage visitors to come back, but articles could be even better.
M content/articles/14.textilecontent/articles/14.textile

@@ -1,12 +1,14 @@

----- permalink: "14" +filters_pre: +- redcloth title: CakePHP hybrids +date: 2006-04-14 09:55:00 +02:00 tags: - cakephp - web-development - php type: article -filter_pre: textile ----- When I first talked to gwoo, CakePHP's project manager, I asked him if Cake had any potential _limitations_. I asked him - I was kidding actually - wether it would be possible to build an application like Gmail using the framework and he - very seriously - simply said _"yes, why not?"_. I repeat myself when I say that CakePHP leaves plenty of freedom to developers within the bounds of its MVC structure: once you grasp the basic logic behind it, your possibilities are endless. I don't want to act as a Ruby on Rails fanatic and boast that _you can do anything with CakePHP_ and things like that, but I can certainly say that CakePHP can be _extended_ and _integrated_ with other collections of scripts, frameworks and projects. With limitations, of course: you probably don't want to force an integration between CakePHP and another MVC/Event Driven/Whatever framework, simply because it would be rather pointless and potential conflicts may occur.
M content/articles/15.textilecontent/articles/15.textile

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

----- permalink: "15" +filters_pre: +- redcloth title: I18n +date: 2006-04-15 15:15:00 +02:00 tags: - cakephp - web-development type: article -filter_pre: textile ----- _"CakePHP will officially support Internationalization (i18n) from version 2.0"_. That is to say: not right now. That doesn't mean we have to wait, no chance! I'm Italian and there are plenty of bakers speaking a language other than English who might want to develop a multi-lingual website.
M content/articles/16.textilecontent/articles/16.textile

@@ -1,12 +1,14 @@

----- permalink: "16" +filters_pre: +- redcloth title: Databases supported by CakePHP +date: 2006-04-17 07:30:00 +02:00 tags: - cakephp - web-development - databases type: article -filter_pre: textile ----- One of the most recurring questions on CakePHP User Group is probably _"Does Cake support X database?"_. Sure, most of us tend to use just MySQL for our websites and applications, but in certain situations some more _exotic_ database support makes the difference. A partial answer to the question above could be _"Yes, probably, at least partially"_: CakePHP offers support for some database "natively" (i.e. Cake folks made some _ad hoc_ database drivers), others through either "ADOdb":http://adodb.sourceforge.net/ or "PEAR::DB":http://pear.php.net/package/DB.
M content/articles/17.textilecontent/articles/17.textile

@@ -1,10 +1,12 @@

----- permalink: "17" +filters_pre: +- redcloth title: New CakePHP Manual (with associations!) +date: 2006-04-18 08:47:00 +02:00 tags: - cakephp type: article -filter_pre: textile ----- Gustavo Carreno just "announced":http://groups.google.com/group/cake-php/browse_thread/thread/4e13231cc383b9bb/6414184c1058fadb#6414184c1058fadb a new release of the "CakePHP Offline Manual":http://cakeforge.org/frs/?group_id=53&release_id=82. Personally I was extremely happy to download this new release because it finally contains documentation and howtos related to CakePHP's Model Associations, which is perhaps one of the most used _advanced_ CakePHP features. So I'll have no excuses not to learn how to use them, great...
M content/articles/18.textilecontent/articles/18.textile

@@ -1,10 +1,12 @@

----- permalink: "18" +filters_pre: +- redcloth title: Textiling +date: 2006-04-21 09:39:03 +02:00 tags: [] type: article -filter_pre: textile ----- Once upon a time I used "BBcode":http://en.wikipedia.org/wiki/BBCode. "CyberArmy":http://base--/bookmarks/view/cyberarmy and all its affiliated sites adopted it as _de-facto_ standard for forums and articles, so consequently more or less all my articles are bbcoded. I could copy and paste the _BBcodeHelper_ I coded for this site, and it could be quite an interesting read for some people... well, tough luck: today I'd like to talk about "Textile":http://base--/bookmarks/view/textile-reference/ instead, which now I consider _the answer_ to all text formatting problems.
M content/articles/19.textilecontent/articles/19.textile

@@ -1,10 +1,12 @@

----- permalink: "19" +filters_pre: +- redcloth title: (Almost) working at Siemens +date: 2006-04-22 03:04:57 +02:00 tags: [] type: article -filter_pre: textile ----- In a recent "blog post":http://www.h3rald.com/blog/view/12/ I was evaluating two job proposals which I was offered, one involving a multi-national company and the other a regional/national but apparently successful IT business. Actually only yesterday I got an official offer from the multi-national company, to be precise, and after evaluating my future possibilities (it took approx 0.03s) I decided to accept this one. To be precise I didn't _officially_ tell them I'd like to start working with them, and I took a few days to "think about it", only because of the damn weekend in between.
M content/articles/20.textilecontent/articles/20.textile

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

----- permalink: "20" +filters_pre: +- redcloth title: In memory of Vittorio Cevasco (1916-2006) +date: 2006-04-26 05:36:00 +02:00 tags: - personal - family type: article -filter_pre: textile ----- Yesterday my grandpa passed away, due to an aggravation of his health condition, breathing problems and various other complications. He died in hospital, on Liberation Day, the Italian national holiday celebrating the liberation of our country from the nazi-fascist regime by the Allied troops and partisans on April 25th 1945. He died exactly 61 years after that day.
M content/articles/21.textilecontent/articles/21.textile

@@ -1,12 +1,14 @@

----- permalink: "21" +filters_pre: +- redcloth title: Birthday present? Web space, please... +date: 2006-04-27 14:47:00 +02:00 tags: - website - hosting - review type: article -filter_pre: textile ----- Today is my birthday! "Not too happy":http://base--/blog/view/20/, but still my birthday after all. What presents did I get from my relatives and friends? Well, various things, but I told my parents and uncles I actually needed some web space... _"What? Didn't you have the hosting sorted out?"_ Well, I had, up to a few days ago when my friends and hosting provider, DeWayne Lehman, decided to close down his "company":http://www.block-house.com. The reason being, to cut a long story short, that he can't keep up with competition: he doesn't have enough customers, and he can't afford server upgrades, while other companies are literally giving space away.
M content/articles/22.textilecontent/articles/22.textile

@@ -1,12 +1,14 @@

----- permalink: "22" +filters_pre: +- redcloth title: Ten minutes on Rails (while eating Cake) +date: 2006-04-29 15:29:00 +02:00 tags: - cakephp - rails - web-development type: article -filter_pre: textile ----- Today I decided to do something different, something I've been dying to do since before coming across CakePHP: give Rails a _proper_ try. Like many other PHP developers out there, when "Ruby on Rails":http://www.rubyonrails.org came out I felt damn jealous and terribly tempted to learn Ruby _only_ to start using such an amazing web development framework. At the time I actually even started reading various tutorials about it, and I was literally amazed at how RoR revolutioned the way of developing web applications.
M content/articles/23.textilecontent/articles/23.textile

@@ -1,10 +1,12 @@

----- permalink: "23" +filters_pre: +- redcloth title: A look at Symfony +date: 2006-05-01 13:42:46 +02:00 tags: [] type: article -filter_pre: textile ----- CakePHP is THE perfect PHP framework, so _we_ don't need anything else. Oh well, no. I personally love CakePHP, but I do believe other PHP frameworks can be interesting and maybe even useful, so today I thought I'd have a look at the "Simfony Project":http://base--/bookmarks/view/simfony/. This framework seems to be mentioned here and there on the Net in many different ways, someone said it can do wonders, some said it's more advanced, others said something like _"qcodo sucks.. cake stinks.. symfony rocks!!!!!"_, so it OUGHT TO be pretty cool, definitely.
M content/articles/24.textilecontent/articles/24.textile

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

----- permalink: "24" +filters_pre: +- redcloth title: CakePHP 1.0 released +date: 2006-05-03 05:06:00 +02:00 tags: - cakephp - web-development type: article -filter_pre: textile ----- As "Digg":http://digg.com/programming/CakePHP_1.0_has_been_released_ points out, the first _stable_ version of CakePHP was released, yesterday. I should have posted yesterday about it, and no, I didn't forget: I was just busy downloading the new version, have a look at the new site, talk to people etc.
M content/articles/25.textilecontent/articles/25.textile

@@ -1,13 +1,15 @@

----- permalink: "25" +filters_pre: +- redcloth title: Digg Effect - the day after +date: 2006-05-05 03:59:00 +02:00 tags: - digg - web20 - web development - internet type: article -filter_pre: textile ----- ...So it turns out that my "last article":http://www.h3rald.com/articles/view/rails-inspired-php-frameworks/ appeared on "Digg":http://www.digg.com homepage. This was quite a pleasant surprise: I didn't expect that an article submitted to _my own site_ could make it that far! I thought you'd need a relatively well-known website, mafia's support, some divine intervention and a terrific amount of luck, but it seems that sometimes an interesting article about an interesting subject can be enough. I'll probably write a more detailed report of what happened soon, in another article rather than a blog post, but for now I just wanted to post a short summary here.
M content/articles/26.textilecontent/articles/26.textile

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

----- permalink: "26" +filters_pre: +- redcloth title: bake.php - Easy baking for lazy folks +date: 2006-05-06 15:43:00 +02:00 tags: - cakephp - frameworks type: article -filter_pre: textile ----- When I first tried Ruby on Rails I was literally amazed by the _generator_ script. Yes, I was young and inexperienced then (six/seven months ago), but you must admit that getting a controller, a model, all the basic views generated automatically by
M content/articles/27.textilecontent/articles/27.textile

@@ -1,10 +1,12 @@

----- permalink: "27" +filters_pre: +- redcloth title: "rdBaker: Bake your CakePHP application online" +date: 2006-05-08 11:50:00 +02:00 tags: - cakephp type: article -filter_pre: textile ----- Right after my "last blog post":http://base--/blog/view/26 I decided to log on #cakephp on irc.freenode.org as usual, and gwoo pops in and says "h3raLd, you didn't review rdBaker yet!" That's right, I didn't yet, so I may as well do it today.
M content/articles/28.textilecontent/articles/28.textile

@@ -1,10 +1,12 @@

----- permalink: "28" +filters_pre: +- redcloth title: (Ready to start) working at Siemens +date: 2006-05-10 09:55:26 +02:00 tags: [] type: article -filter_pre: textile ----- I signed it yesterday, around 3PM. I gave "them":http://base--/bookmarks/view/siemens/ all the necessary documents and they presented me their contract to sign, I'll have to hand it in on Tuesday at 9AM, my first day at work.
M content/articles/29.textilecontent/articles/29.textile

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

----- permalink: "29" +filters_pre: +- redcloth title: Writing more articles... +date: 2006-05-14 06:26:00 +02:00 tags: - website - writing type: article -filter_pre: textile ----- Yes, I know, I've been slaking a little bit, and haven't posted on my blog in a while. Well, I actually _didn't_ slack at all in these days getting ready to start my job, looking for a damn fitted kitchen for my house and... writing more articles.
M content/articles/30.textilecontent/articles/30.textile

@@ -1,10 +1,12 @@

----- permalink: "30" +filters_pre: +- redcloth title: Working! +date: 2006-05-18 13:13:07 +02:00 tags: [] type: article -filter_pre: textile ----- Yes, I started "working" at the "Siemens/Microsoft MES Expertise Center":http://base--/bookmarks/view/siemens-mes/ two days ago, and you can tell from the lack of activity on my blog, for example. That's the first _real_ and _full-time_ job for me, and yes, I noticed the difference from an "I-get-up-whenever-and-do-whatever" policy to a slightly stricter "get-up-at-seven-and-go-to-work" policy: I obviously don't have the same amount of free time as before, nevertheless I really can't complain.
M content/articles/31.textilecontent/articles/31.textile

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

----- permalink: "31" +filters_pre: +- redcloth title: "Watch out: CakePHP screencasts" +date: 2006-05-20 15:47:00 +02:00 tags: - cakephp - tutorial type: article -filter_pre: textile ----- Tutorials are great, articles are helpful, manuals are essential and the API is your best friend, but there's still something missing there... Unfortunately podcasts are not yet available, but the CakePHP team is proud to announce the creation of two "screencasts":http://cakephp.org/pages/screencasts in an effort to help new bakers familiarizing with CakePHP's concepts. This is old news now, the screencasts section came together with the "site overhaul":http://base--/blog/view/24 but I only got a chance to take a look at them (one of them only, to be totally honest) recently, and so here's a spoil... erhm, a _detailed_ description of John Anderson's screencast about the "Blog Tutorial":http://manual.cakephp.org/chapter/18.
M content/articles/32.textilecontent/articles/32.textile

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

----- permalink: "32" +filters_pre: +- redcloth title: Writing Tools +date: 2006-05-25 14:57:00 +02:00 tags: - writing - tools type: article -filter_pre: textile ----- Since in these days (and even more in near future) I'm really writing a lot I thought it would be good to share my thoughts on some writing programs and tools I started using for writing these blog posts, articles, and more.
M content/articles/33.textilecontent/articles/33.textile

@@ -1,12 +1,14 @@

----- permalink: "33" +filters_pre: +- redcloth title: Information Mapping +date: 2006-06-02 06:10:00 +02:00 tags: - productivity - writing - note-taking type: article -filter_pre: textile ----- As I thought, my job also represents a great opportunity to learn new things. I don't mean only new technical stuff, but also a great deal of tips, best practices and methods to efficiently write documentation material in proper English. Some theory about "Information Mapping":http://www.infomap.com/ was by far the most interesting topic I learnt about this week.
M content/articles/34.textilecontent/articles/34.textile

@@ -1,13 +1,15 @@

----- permalink: "34" +filters_pre: +- redcloth title: "Akelos Framework: too good to be true?" +date: 2006-06-10 11:26:00 +02:00 tags: - frameworks - php - web-development - review type: article -filter_pre: textile ----- Someone recently added a comment to my article about "Rails-inspired PHP frameworks":http://base--/articles/rails-inspired-php-frameworks/ pointing out that I forgot another Rails-like framework, in my round-up. He obviously posted a link to this rather mysterious Rails port in PHP and spam or not, I'd like to thank this guy for letting me know of the existance of "Akelos":http://base--/bookmarks/view/akelos-framework, a new PHP framework which seems simply too good to be true.
M content/articles/35.textilecontent/articles/35.textile

@@ -1,10 +1,12 @@

----- permalink: "35" +filters_pre: +- redcloth title: Some essential tools to survive in a corporate environment +date: 2006-06-18 07:55:26 +02:00 tags: [] type: article -filter_pre: textile ----- A month has passed since I started working at the "MES Expertise Center":http://base--/bookmarks/view/mes-expertise.center/, and I must say I'm very impressed after all. I started with a two-weeks course on SIMATIC IT Production Suite, the flagship product developed by Siemens here in Genoa, and it was a real piece of cake: the trainers were very prepared and everything was explained very clearly for both us internal workers and the customers attending the lessons. In my opinion this is one of the most successful things Siemens and Microsoft achieved when they opened the MES Expertise Center: creating a place where both Siemens staff and partners can learn and experiment new cutting-edge MES-related products. Even during the course, when someone asked a particularly complex question and the trainer couldn't answer, consultants or even R&D staff were immediately contacted (also because they were literally next door...) to provide an authoritative and exhaustive answer.
M content/articles/36.textilecontent/articles/36.textile

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

----- permalink: "36" +filters_pre: +- redcloth title: "ITALIA: CAMPIONE DEL MONDO!" +date: 2006-07-12 09:19:00 +02:00 tags: - sport - soccer type: article -filter_pre: textile ----- _*Italy has won the World Cup!*_
M content/articles/37.textilecontent/articles/37.textile

@@ -1,12 +1,14 @@

----- permalink: "37" +filters_pre: +- redcloth title: Some updates +date: 2006-07-25 03:07:00 +02:00 tags: - website - cakephp - design type: article -filter_pre: textile ----- Quite a bit of time passed since the last blog post, and I'm actually sorry about that, but as I thought, I don't have as much free time as I used to be. Work is work, after all! This post will be multipurpose as actually I bluid up a few things to write about in the last few days... erhm, ok, _weeks_.
M content/articles/38.textilecontent/articles/38.textile

@@ -1,13 +1,15 @@

----- permalink: "38" +filters_pre: +- redcloth title: Akelos is real, after all... +date: 2006-08-02 01:33:00 +02:00 tags: - frameworks - php - web-development - review type: article -filter_pre: textile ----- Bermi Ferrer kept his promise, and even if a few were skeptic on the "pre-announced":http://base--/blog/view/34/ features of his upcoming Akelos framework, last week he sent me a "development preview" and a few days ago he opened the development SVN repository to the public:
M content/articles/39.textilecontent/articles/39.textile

@@ -1,12 +1,14 @@

----- permalink: "39" +filters_pre: +- redcloth title: Why I like Netvibes +date: 2006-09-18 05:51:00 +02:00 tags: - web20 - ajax - review type: article -filter_pre: textile ----- The so-called "AJAX Start Pages" are not a new concept anymore, and like for almost any other offspring of Web 2.0 there is more than one to chose from. Hence the increasing number of comparative reviews on the Web nowadays (Yes, I'm guilty of that too). I soon learnt that for any "good and useful thing" on the web there are at least _n_ clones: consider for example social bookmarking, community-powered news sites, php frameworks... And no, you can't use the word clone because it has a strong negative connotation nowadays so let's just say that whenever someone comes up with a new idea, others examine it, process it and in a few weeks (days?) some _very, very similar application_ comes out, and it's _better_ than the previous one.
M content/articles/40.textilecontent/articles/40.textile

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

----- permalink: "40" +filters_pre: +- redcloth title: "Introducing: \"CakePHP Recipes\"" +date: 2006-11-02 05:25:00 +01:00 tags: - cakephp - writing type: article -filter_pre: textile ----- Despite all my efforts to keep the whole thing quiet for the time being, a few days ago I entered the words "CakePHP Recipes" in Google and discovered - to my astonishment - that my new book about the CakePHP framework is already for (pre)sale in many popular online bookstores.
M content/articles/41.textilecontent/articles/41.textile

@@ -1,10 +1,12 @@

----- permalink: "41" +filters_pre: +- redcloth title: Comments temporarily disabled +date: 2007-01-07 06:53:00 +01:00 tags: - website type: article -filter_pre: textile ----- As a few of you might have noticed, I decided to disable comments on all the sections of this site, as a temporary measure against spam.
M content/articles/42.textilecontent/articles/42.textile

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

----- permalink: "42" +filters_pre: +- redcloth title: Too many cooks spoil the Cake book +date: 2007-03-07 02:45:00 +01:00 tags: - cakephp - writing type: article -filter_pre: textile ----- I am sorry to announce that my upcoming book, CakePHP Recipes, will not be published anymore. As a matter of fact, it wasn't finished because some of the people involved failed to comply with the terms of their contract in delivering material which was suitable for publication.
M content/articles/43.textilecontent/articles/43.textile

@@ -1,12 +1,14 @@

----- permalink: "43" +filters_pre: +- redcloth title: Time for a diet... +date: 2007-03-09 11:59:00 +01:00 tags: - cakephp - rant - writing type: article -filter_pre: textile ----- My fianc&eacute;e keeps telling me that too many cakes are not good for me, and I never listen: I always liked cakes! I *did* like the CakePHP(TM)[1] framework too, once, and I *did* write "some articles":http://www.h3rald.com/projects/view/cakephp-herald about it in the past, and I believe at least a bunch of Bakers found them useful, especially at the time. I do believe the Cake(TM) Software Foundation[1] quite liked having their framework featured on popular websites like php|architect and SitePoint, and I believe that I contributed - to some extent - to make it one of the most popular frameworks available for the PHP programming language.
M content/articles/8.textilecontent/articles/8.textile

@@ -1,12 +1,14 @@

----- permalink: "8" +filters_pre: +- redcloth title: New site operative +date: 2006-04-06 16:57:00 +02:00 tags: - website - web-development - cakephp type: article -filter_pre: textile ----- Yes, it works. Perhaps it's a tiny bit slower than expected but the new h3raLd.com seems to work. I'll probably find some new exciting bugs to fix in the next few hours, as usual - that will be annoying but perfectly normal.
M content/articles/9.textilecontent/articles/9.textile

@@ -1,10 +1,12 @@

----- permalink: "9" +filters_pre: +- redcloth title: Riddle me this... and you'll get the job! +date: 2006-04-07 16:13:58 +02:00 tags: [] type: article -filter_pre: textile ----- Today I had my _n^th^_ job interview. Yes, I'm getting used to them by now, and it's becoming quite entertaining: if they _paid_ me for just take interviews I'd do that for all my life quite happily! But since that's not going to happen I'd better get a move on and find a so called _real job_. Actually this time it wasn't the usual complete waste of time and this company _nearly_ made me a proper offer: they're gonna see me again next week, so let's hope for the best.
M content/articles/a-look-at-drupal.bbcodecontent/articles/a-look-at-drupal.bbcode

@@ -1,12 +1,14 @@

----- permalink: a-look-at-drupal +filters_pre: +- bbcode title: A look at Drupal +date: 2006-01-12 07:42:44 +01:00 tags: - php - web-development - review type: article -filter_pre: bbcode ----- [i][b]Important Notice:[/b] This article is about changes occurring to zZine Magazine's site[1]. At the time of writing, www.zzine.org uses the old site, and not the Drupal-based one presented in this article, which is currently under construction[18].[/i]
M content/articles/akelos-interview.textilecontent/articles/akelos-interview.textile

@@ -1,13 +1,15 @@

----- permalink: akelos-interview +filters_pre: +- redcloth title: An Interview with the creator of the Akelos Framework +date: 2007-07-19 05:02:00 +02:00 tags: - php - rails - cakephp - frameworks type: article -filter_pre: textile ----- I "already":http://www.h3rald.com/blog/34 "covered":http://www.h3rald.com/blog/38 the Akelos PHP framework in the past, but for those who don't know it, Akelos seems to be one of the few "Rails-inspired PHP frameworks":http://www.h3rald.com/articles/rails-inspired-php-frameworks still worth mentioning, besides CakePHP and Symphony of course.
M content/articles/apache2-upgrade.textilecontent/articles/apache2-upgrade.textile

@@ -1,10 +1,13 @@

----- permalink: apache2-upgrade +filters_pre: +- erb +- redcloth title: Beware of sudden upgrades! +date: 2007-12-20 07:41:00 +01:00 tags: - website rails type: article -filter_pre: textile ----- Yesterday I got a rather annoying early Christmas present: when visiting my site, I noticed that the raw source code of my dispatch.fcgi file (yes, I'm on shared hosting with FastCGI, for now) was displayed "as it is" instead of being interpreted.

@@ -32,7 +35,7 @@ AddHandler fastcgi-script .fcgi

# Apache 2: AddHandler fcgid-script .fcgi -</typo:code> +<% end %> See? Different. This is due to the fact that "@mod_fcgid@ is used instead of @mod_fastcgi@ on Apache 2":http://wiki.rubyonrails.org/rails/pages/Debian+mod_fastcgi+Notes.
M content/articles/back-from-holiday.textilecontent/articles/back-from-holiday.textile

@@ -1,10 +1,12 @@

----- permalink: back-from-holiday +filters_pre: +- redcloth title: Back from holiday +date: 2007-08-30 04:59:00 +02:00 tags: - personal website writing type: article -filter_pre: textile ----- I'm back. I was so eager to go on holiday that I didn't even bother writing a post about it, too bad. I actually when on holiday for a week but I thought I'd take three weeks off from my blog duties in favor of laziness and relax, but unfortunately my laptop decided to go wrong as well, so I didn't actually manage to relax that much.
M content/articles/boolean-search.bbcodecontent/articles/boolean-search.bbcode

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

----- permalink: boolean-search +filters_pre: +- bbcode title: Understanding Boolean Search +date: 2005-12-10 12:57:16 +01:00 tags: - internet - google type: article -filter_pre: bbcode ----- These days, it is necessary to use a search engines to find the information you want. When the World Wide Web was smaller, search engines weren't an essential websurfing tool, but once the Web started growing exponentially, and hosting literally billions of documents and files, even normal searches aren't enough to find important information, especially when it is not readily available. So, I'm going to show you a more powerful way to search.[b]Learning how to search[/b]
M content/articles/cakephp-first-bite.textilecontent/articles/cakephp-first-bite.textile

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

----- permalink: cakephp-first-bite +filters_pre: +- redcloth title: "The CakePHP Framework: Your First Bite" +date: 2006-07-14 04:03:00 +02:00 tags: - cakephp - tutorial - review type: article -filter_pre: textile ----- According to a recent study, PHP is one of the most popular programming languages in the world. In spite of this, PHP is often criticized for its inconsistent naming conventions, its lack of important features as compared to other languages (like namespaces) and its inherent disorganization. Furthermore, PHP is very easy to learn, and this has often led to the common misconception that most PHP developers are inexperienced and that their code is therefore prone to security vulnerabilities and exploits."Read the full article":http://www.sitepoint.com/article/application-development-cakephp on "SitePoint.com":http://www.sitepoint.com/
M content/articles/cakephp-overview.textilecontent/articles/cakephp-overview.textile

@@ -1,12 +1,14 @@

----- permalink: cakephp-overview +filters_pre: +- redcloth title: An overview of the CakePHP framework +date: 2006-05-30 15:50:20 +02:00 tags: - cakephp - review - tutorial type: article -filter_pre: textile ----- _"There are many frameworks available for the PHP programming language nowadays, and especially a lot of RAD (Rapid Application Development) frameworks which aim to make web development faster, less tedious and more organized. CakePHP was one of the first frameworks to port the RAD philosophy - which became so popular after Ruby on Rails - to the PHP programming language. CakePHP v1.0 is now one of the most popular and intuitive solutions for PHP programming, let's discover why..."_
M content/articles/cakephp.bbcodecontent/articles/cakephp.bbcode

@@ -1,13 +1,15 @@

----- permalink: cakephp +filters_pre: +- bbcode title: CakePHP - A 'tasty' solution for PHP programming +date: 2005-12-08 17:03:39 +01:00 tags: - cakephp - review - frameworks - web-development type: article -filter_pre: bbcode ----- Web developers can either love or hate PHP, and one of the criticisms of this easy-to-use programming language which is repeated over and over on IRC, forums and blogs is that "PHP is disorganized". Is this really true? If so, is there any possible way to write a PHP application in a logical and clean way? Read on...Every web developer has certainly heard of PHP. Some people like it and consider it a powerful and easy-to-use way to create complex websites or web applications, while others are convinced that it is merely a bad copy of Perl. Opinions are certainly mixed on the matter.
M content/articles/concatenative-020.textilecontent/articles/concatenative-020.textile

@@ -1,10 +1,13 @@

----- permalink: concatenative-020 +filters_pre: +- erb +- redcloth title: Concatenative 0.2.0 released +date: 2009-04-19 09:42:00 +02:00 tags: - ruby concatenative type: article -filter_pre: textile ----- Version 0.2.0. of the "Concatenative":/concatenative DSL has been "released":http://rubyforge.org/frs/?group_id=8068&release_id=33575.

@@ -26,9 +29,9 @@ Oddly enough, I realized that it is possible to defined methods named after reserved words like "while" or "if", so now all the concatenative words (combinators) in @kernel.rb@ are now defined _without_ a leading undersore. Similarly, there's no real need to use UPPERCASE symbols, so as a result, method lookup is significantly faster and will use less resources.

Here's how the lookup works. Say you have the following program: -<typo:code lang="ruby"> +<% highlight :ruby do %> [[1,2,3], [4.5.6], :concat] -</typo:code> +<% end %> If @:concat@ has been defined by the user (@:concat <= [...]@), that definition will be used, otherwise the @Concatenative::Kernel@ combinator @concat@ will be called. If you want to use the corresponding Ruby method, all you have to do is specifying the arity explicitly using the @|@ operator.
M content/articles/concatenative-programming-in-ruby.textilecontent/articles/concatenative-programming-in-ruby.textile

@@ -1,10 +1,13 @@

----- permalink: concatenative-programming-in-ruby +filters_pre: +- erb +- redcloth title: Concatenative programming in Ruby +date: 2009-03-28 07:24:00 +01:00 tags: - ruby concatenative programming type: article -filter_pre: textile ----- A while ago, I sat down examining a few "alternative programming languages":http://www.h3rald.com/articles/10-programming-languages I might decide to learn someday. Each of those languages has its own peculiarities, and I didn't choose them randomly, I chose them based on their popularity, power, paradigm and how actively they are developed.

@@ -35,11 +38,11 @@ @square == dup *@

In Ruby, this would be: -<typo:code lang="ruby"> +<% highlight :ruby do %> def square(x) x*x end -</typo:code> +<% end %> What's unusual here? &mdash; Simple, there are no _variables_ involved. Joy doesn't need any explicit variable or _formal parameters_ of any sort.

@@ -49,9 +52,9 @@ @[1 2 3 4] [dup *] map@

The @map@ combinator expects a list and a _quoted program_ (the same one used to compute the square) and produces a new list containing the result of that program applied to each element of the original list. Basically the equivalent of: -<typo:code lang="ruby"> +<% highlight :ruby do %> [1,2,3,4].map { |e| e*e } -</typo:code> +<% end %> Do you notice anything different? &mdash; Yes, Joy doesn't need blocks or lambdas either, it uses _quoted programs_ instead, which are nothing but slightly fancier lists (or arrays, as you like).

@@ -80,15 +83,15 @@ @2 2 +@

We _could_ translate it into infix notation (@2 + 2@), because Ruby supports it, but it's not general enough. What you could do is this though: -<typo:code lang="ruby">2.send(:+, 2)</typo:code> +<% highlight :ruby do %>2.send(:+, 2)<% end %> Message sending. I can see all the SmallTalk sympathizers drooling already. Well yes, In Ruby, _everything_ is an object, so _everything_ has a receiver and maybe some parameters. In other words, every method call can be reduced to the following syntax: -<typo:code lang="ruby">receiver.send(method, *params)</typo:code> +<% highlight :ruby do %>receiver.send(method, *params)<% end %> In this way, it is safe to assume that everything has a receiver, which could be understood as a function parameter, and may have 0 or more parameters. Take the following then: -<typo:code lang="ruby">[2, 2, :+]</typo:code> +<% highlight :ruby do %>[2, 2, :+]<% end %> It's not too different from Joy, and it's still Ruby code. All you have to do is use something to do the following:

@@ -104,9 +107,9 @@ Unfortunately Ruby's @arity@ method isn't that reliable. For example: @"test".instance_method(:sub).arity@ returns -1, while it should return "2" to be useful. So we have no choice but find a way to pass the method's arity explicitly, in some cases.

For example like this: -<typo:code lang="ruby"> +<% highlight :ruby do %> ["Ciao, Fabio", /Ciao/, "Hello", :sub|2] -</typo:code> +<% end %> If we define a | operator for the Symbol class, it's not too bad after all. It's heavy, but in this way we can use _any_ Ruby method in postfix notation.

@@ -114,7 +117,7 @@ h3. Introducing the Concatenative Ruby DSL

"Concatenative":/concatenative is a simple Ruby DSL for concatenative programming. You can write concatenative programs inside ordinary Ruby arrays and execute them by calling either @Array#execute@ or @Kernel#concatenate@, like this: -<typo:code lang="ruby"> +<% highlight :ruby do %> require 'concatenative' concatenate(

@@ -125,7 +128,7 @@ [:dup, 1, :-],

[:*], :linrec ) -</typo:code> +<% end %> This simple program calculates the factorial of 10. As you can see, no matter how unusual it may look, it is perfectly valid Ruby code and it is equivalent to the following Joy code:
M content/articles/design-patterns-in-ruby-review.textilecontent/articles/design-patterns-in-ruby-review.textile

@@ -1,10 +1,12 @@

----- permalink: design-patterns-in-ruby-review +filters_pre: +- redcloth title: "Book Review: Design Patterns in Ruby" +date: 2008-04-11 05:41:00 +02:00 tags: - ruby review books type: article -filter_pre: textile ----- !>/files/design_patterns_in_ruby.jpg!
M content/articles/efficient-ruby-code-shortcut-review.textilecontent/articles/efficient-ruby-code-shortcut-review.textile

@@ -1,10 +1,12 @@

----- permalink: efficient-ruby-code-shortcut-review +filters_pre: +- redcloth title: "Book Review: Writing Efficient Ruby Code" +date: 2008-01-21 05:47:00 +01:00 tags: - ruby review books type: article -filter_pre: textile ----- !>/files/efficient_ruby_shortcut.jpeg!
M content/articles/firefox-lovers-guide-to-opera.textilecontent/articles/firefox-lovers-guide-to-opera.textile

@@ -1,10 +1,12 @@

----- permalink: firefox-lovers-guide-to-opera +filters_pre: +- redcloth title: A Firefox Lover's Guide to Opera +date: 2007-12-28 14:19:00 +01:00 tags: - browsers review opera firefox type: article -filter_pre: textile ----- 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 &ndash; myself &ndash; who has been using Firefox for years and is now considering another browser switch.
M content/articles/firefox3-revealed.textilecontent/articles/firefox3-revealed.textile

@@ -1,10 +1,12 @@

----- permalink: firefox3-revealed +filters_pre: +- redcloth title: Firefox 3 Revealed +date: 2008-06-17 04:46:00 +02:00 tags: - firefox browsers writing review books type: article -filter_pre: textile ----- When the SitePoint staff asked me to write an article summing up all the new features of Firefox 3, I gladly accepted: I wrote about Firefox before, and I thought it was just going to be a 2-3 hours job maximum. After diving deeper into Firefox 3 development, reading dozens of different blogs and scouting Mozilla's web sites, I realized I was wrong: Firefox 3 introduced _a lot_ of new things, and keeping track of all of them, I admit, was quite a hard task.
M content/articles/from-firefox-to-deer-park.bbcodecontent/articles/from-firefox-to-deer-park.bbcode

@@ -1,12 +1,14 @@

----- permalink: from-firefox-to-deer-park +filters_pre: +- bbcode title: From Firefox to... Deer Park? +date: 2005-11-20 19:05:30 +01:00 tags: - firefox - browsers - review type: article -filter_pre: bbcode ----- On May 31st 2005 the Mozilla Foundation silently released the Deer Park browser... no, it's not another name change for Firefox, but the codename they gave to the long-awaited 1.1 release of the free, famous, award-winning browser. Actually what we have for now is just a non-feature complete developer preview release of the new milestone, the first alpha release, in other words. The alpha release nevertheless seems to be fully functional and already useable.ETAs for the actual stable version are not given as usual, but we should expect another alpha candidate soon hopefully (They wrote "June" on the [url=http://www.mozilla.org/projects/firefox/]roadmap[/url], and we're already in July). Anyhow, this developer-oriented preview release can be [url=http://www.mozilla.org/projects/firefox/]downloaded[/url] and installed on Windows, Linux, and Mac OS X systems plus eventually, [url=http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/deerpark/alpha1/contrib/]Solaris and others[/url]. The decision of using the codename Deer Park instead of naming the release Firefox 1.1 alpha 1 or something of the like was made to avoid the havoc which occurred before the official release of Firefox 1.0 (which was codenamed "Phoenix" by the way,) when some websites offered a late preview release as the actual new version to download. This time when you install and run the program the Firefox name has been substituted with Deer Park Alpha 1, so for example Deer Park is used in the browser's title bar and in the "About Deer Park Alpha 1" menu under "Help". The icon they used for this testing release is not even the usual firefox icon - it represents a plain blueish globe with no fox whatsoever. They have definitely put in effort this time to avoid confusion.
M content/articles/git-for-the-locals.textilecontent/articles/git-for-the-locals.textile

@@ -1,10 +1,13 @@

----- permalink: git-for-the-locals +filters_pre: +- erb +- redcloth title: Git for the Locals +date: 2008-07-15 06:18:00 +02:00 tags: - programming type: article -filter_pre: textile ----- _"This is a *local* shop for *local* people, we want no trouble here!"_

@@ -36,7 +39,7 @@ <typo:code>

git init git add . git commit -</typo:code> +<% end %> This will create your new repository in the current directory, add all your files and filders recursively, and perform the initial commit. What's so hard in this? Nothing. And it's faster than SVN, for sure.
M content/articles/google-apps-for-your-domain.textilecontent/articles/google-apps-for-your-domain.textile

@@ -1,6 +1,9 @@

----- permalink: google-apps-for-your-domain +filters_pre: +- redcloth title: "Google Apps for your domain: a shared hosting killer service?" +date: 2006-08-28 05:51:00 +02:00 tags: - google - internet

@@ -8,7 +11,6 @@ - ajax

- web20 - review type: article -filter_pre: textile ----- A while ago Google started offering services like "Google Mail":http://mail.google.com/mail/ (Gmail) and "Google Calendar":http://www.google.com/calendar/ to domain owners. Sure everyone likes Gmail, but one of the few bad things about it is that it never feels "unique": your email address is always gonna be <something>@gmail.com or <something>@googlemail.com. Not a big deal? Well, sure, not really, but it really depends on the people using the service and how fussy they are:
M content/articles/google-chrome.textilecontent/articles/google-chrome.textile

@@ -1,10 +1,12 @@

----- permalink: google-chrome +filters_pre: +- redcloth title: "Chrome: Google did it again!" +date: 2008-09-03 02:31:00 +02:00 tags: - browsers review google type: article -filter_pre: textile ----- !</files/google-chrome/chrome-logo.jpg!
M content/articles/google-earth.bbcodecontent/articles/google-earth.bbcode

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

----- permalink: google-earth +filters_pre: +- bbcode title: "Software Review: Google Earth" +date: 2005-12-10 12:48:59 +01:00 tags: - review - google type: article -filter_pre: bbcode ----- Almost every person on Earth has seen an image taken from a satellite at least once in his or her life: now imagine putting all those images together to make a sort of "patchwork world"...this is unfortunately not as simple as gluing atlas maps together, because height, resolution and orientation must be considered. However, "A computer could do all that"...and so it happened![b]In the beginning...[/b]
M content/articles/h3rald-71.textilecontent/articles/h3rald-71.textile

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

----- permalink: h3rald-71 +filters_pre: +- redcloth title: Introducing H3RALD.com v7.1 +date: 2008-10-27 05:29:00 +01:00 tags: - website - rails type: article -filter_pre: textile ----- I finally decided to redesign my web site. About 2 years passed since last time and I think this was long overdue: a lot of people liked the black _Nitefall_ theme, but a lot of people found a bit too dark for their liking.
M content/articles/h3rald-v7-overview.textilecontent/articles/h3rald-v7-overview.textile

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

----- permalink: h3rald-v7-overview +filters_pre: +- redcloth title: Back on Track... +date: 2007-06-22 14:38:00 +02:00 tags: - website - rails type: article -filter_pre: textile ----- ...or better, on "Rails":http://www.rubyonrails.org_. Yep, this 7th (!) version of the H3RALD website is powered by the overly-popular Ruby web framework _and_ by the "Typo":http://www.typosphere.org blogging platform.
M content/articles/herald-vim-color-scheme.textilecontent/articles/herald-vim-color-scheme.textile

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

----- permalink: herald-vim-color-scheme +filters_pre: +- redcloth title: Herald (Vim Color Scheme) +date: 2009-06-17 06:11:00 +02:00 tags: - programming - vim type: article -filter_pre: textile ----- 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!).
M content/articles/hlrb-review.textilecontent/articles/hlrb-review.textile

@@ -1,10 +1,12 @@

----- permalink: hlrb-review +filters_pre: +- redcloth title: "Book Review: Humble Little Ruby Book" +date: 2007-10-03 05:53:00 +02:00 tags: - ruby review books type: article -filter_pre: textile ----- After reading the very first paragraph of Mr. Neighborly's "Humble Little Ruby Book":http://www.humblelittlerubybook.com/ (HLRB for short, from now on) it was very clear to me that it was going to be quite an unconventional read:
M content/articles/holiday-house-for-rent.textilecontent/articles/holiday-house-for-rent.textile

@@ -1,10 +1,12 @@

----- permalink: holiday-house-for-rent +filters_pre: +- redcloth title: Holiday house for rent +date: 2009-04-24 01:54:00 +02:00 tags: - personal type: article -filter_pre: textile ----- <img src="/images/sessarego/outside.jpg" style="float:left; border: 1px solid #B80000; margin-right: 10px;" />
M content/articles/ie-lovers-guide-to-firefox.bbcodecontent/articles/ie-lovers-guide-to-firefox.bbcode

@@ -1,6 +1,9 @@

----- permalink: ie-lovers-guide-to-firefox +filters_pre: +- bbcode title: An IE Lover's Guide to Firefox +date: 2005-11-25 18:47:00 +01:00 tags: - ie - firefox

@@ -8,7 +11,6 @@ - microsoft

- firefox - browsers type: article -filter_pre: bbcode ----- This is an attempt to explain to Internet Explorer users what Mozilla Firefox is, what its features are and how it can be enhanced or customized. Although this article is written primarily for IE users, it will make interesting reading for any Firefox user who wants to try to convince even the most hopeless IE fan to adopt Firefox for everyday use. [b][u]My Point of View[/u][/b]
M content/articles/im-on-twitter-anyway.textilecontent/articles/im-on-twitter-anyway.textile

@@ -1,10 +1,12 @@

----- permalink: im-on-twitter-anyway +filters_pre: +- redcloth title: I'm on Twitter, anyway... +date: 2008-05-18 11:04:00 +02:00 tags: - personal review programming type: article -filter_pre: textile ----- I've been neglecting my blog, I know. The truth is that I'm quite busy in this period: I have more responsibilities in my daily full-time jobs, my lunch breaks are getting shorter and I don't have much free time. At any rate, here's what's going on:
M content/articles/incomplete-guide-to-london.textilecontent/articles/incomplete-guide-to-london.textile

@@ -1,10 +1,12 @@

----- permalink: incomplete-guide-to-london +filters_pre: +- redcloth title: Fabio's (In)complete Guide to London +date: 2006-08-23 06:23:24 +02:00 tags: - travelling type: article -filter_pre: textile ----- This summer I finally had a chance to spend _a whole week_ in London. The city itself was not new to me, since I visited it 6 times before this one, but this summer was different, in a word: Roxy (my fiancee)'s brother Caspar was happy to host us at his place, for free.<a name="top"></a>
M content/articles/inline-introduction.textilecontent/articles/inline-introduction.textile

@@ -1,10 +1,13 @@

----- permalink: inline-introduction +filters_pre: +- erb +- redcloth title: RawLine - a 100% Ruby solution for console inline editing +date: 2008-03-10 06:59:00 +01:00 tags: - ruby programming opensource rawline type: article -filter_pre: textile ----- One of the many things I like about Ruby is its cross-platform nature: as a general rule, Ruby code runs on everything which supports Ruby, regardless of its architecture and platform (yes, there are quite a few exceptions, but let's accept this generalization for now).

@@ -28,7 +31,7 @@ Believe it or not, that tiny method can do wonders...h2. Reverse-engineering escape codes

So here's a little script which uses @get_character()@ in an endless loop, diligently printing the character codes corresponding to a keystroke: -<typo:code lang="ruby"> +<% highlight :ruby do %> #!/usr/local/bin/ruby -w require 'rubygems'

@@ -48,7 +51,7 @@ else puts "#{char.chr} [#{char}] (hex: #{char.to_s(16)})";

end end -</typo:code> +<% end %> A pretty harmless little thing. Try to run it and press some keys, and see what you get:

@@ -144,13 +147,13 @@ * Regarding the @completion_proc@, typically you may want to return only the elements matching the word which is currently being written, so that's given as default parameter for your proc. Exactly like with ReadLine, the only difference is that you can access other things like _the whole line_ and _the whole history_ in real time, which can be really handy at times!

Here's a simple example: -<typo:code lang="ruby"> +<% highlight :ruby do %> editor.completion_proc = lambda do |word| if word ['select', 'update', 'delete', 'debug', 'destroy'].find_all { |e| e.match(/^#{Regexp.escape(word)}/) } end end -</typo:code> +<% end %> h3. Custom key bindings

@@ -168,12 +171,12 @@ * A @Hash@ to define a new key or escape sequences

So, in the end you can do things like this: -<typo:code lang="ruby"> +<% highlight :ruby do %> editor.bind(:left_arrow) { editor.move_left } editor.bind("\etest") { editor.overwrite_line("Test!!") } editor.bind(?\C-z) { editor.undo } editor.bind([24]) { exit } -</typo:code> +<% end %> Which, for Rubyists, it's far sexier and more flexible than editing an .inputrc file.

@@ -181,7 +184,7 @@ h3. How do I use it, anyway?

A code example is better than a thousand words, right? So here you are: -<typo:code lang="ruby"> +<% highlight :ruby do %> #!/usr/local/bin/ruby -w require 'rubygems'

@@ -209,7 +212,7 @@

loop do puts "You typed: [#{editor.read("=> ").chomp!}]" end -</typo:code> +<% end %> This example can be found in examples/rawline_shell.rb within the RawLine source code or gem package.
M content/articles/inline-name-change.textilecontent/articles/inline-name-change.textile

@@ -1,10 +1,12 @@

----- permalink: inline-name-change +filters_pre: +- redcloth title: "InLine name change: what's your opinion?" +date: 2008-03-27 06:30:00 +01:00 tags: - ruby programming opensource rawline type: article -filter_pre: textile ----- I've been kindly asked by the lead developer of "RubyInLine":http://www.zenspider.com/ZSS/Products/RubyInline/ to change the name of my "InLine":http://rubyforge.org/projects/inline/ project, due to potential confusion and conflicts.
M content/articles/introducing-redbook.textilecontent/articles/introducing-redbook.textile

@@ -1,10 +1,12 @@

----- permalink: introducing-redbook +filters_pre: +- redcloth title: Introducing RedBook (and the new Code section) +date: 2007-09-29 02:12:00 +02:00 tags: - ruby productivity software tools redbook type: article -filter_pre: textile ----- I'm somehow pleased to announce the opening of a new section on this site. Nothing too big actually, it's just a "page":/code/ with a few (one for now) brief descriptions of open source programs and scripts I made and I'd like to share with my readers.
M content/articles/komodo-edit-review.textilecontent/articles/komodo-edit-review.textile

@@ -1,10 +1,12 @@

----- permalink: komodo-edit-review +filters_pre: +- redcloth title: A closer look at Komodo Edit +date: 2007-11-25 07:23:00 +01:00 tags: - review programming software type: article -filter_pre: textile ----- <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/log-apr-2009.textilecontent/articles/log-apr-2009.textile

@@ -1,13 +1,15 @@

----- permalink: log-apr-2009 +filters_pre: +- redcloth title: Personal Log - April 2009 +date: 2009-04-28 06:11:00 +02:00 tags: - personal_log - ruby - books - wedding type: article -filter_pre: textile ----- April is tratidionally a rather busy month: Easter, public holidays, and &mdash; always &mdash; some deadline to meet at work. Moreover, my birthday is also in April which makes it even more busy! Let's see what happened this year...h3. Using Ruby in a corporate environment
M content/articles/log-feb-2009.textilecontent/articles/log-feb-2009.textile

@@ -1,10 +1,12 @@

----- permalink: log-feb-2009 +filters_pre: +- redcloth title: Personal Log - February 2009 +date: 2009-02-27 13:09:00 +01:00 tags: - "personal_log ruby " type: article -filter_pre: textile ----- This has been a rather busy month, hence the lack of general Internet activity. I really wanted to post some more articles to my site, but for one reason or another I had to procrastinate more and more, and here we are at the end of the month again.
M content/articles/log-jan-2009.markdown smartypantscontent/articles/log-jan-2009.markdown

@@ -1,10 +1,12 @@

----- permalink: log-jan-2009 +filters_pre: +- bluecloth title: Personal Log - January 2009 +date: 2009-01-25 11:51:00 +01:00 tags: - personal_log wedding type: article -filter_pre: markdown smartypants ----- Those who read my blog regularly may have noticed how I normally refrain from posting articles concerning my own life. I used to have a more blog-like web site, but things changed: _"Who would want to read about my life, anyway?"_ &mdash; That's what I always thought. Hence, I focused on writing general-interest, computer-related articles about programming in Ruby, about some IT book which came out, or about the latest chapter in the Browser Wars. You'll find all this in the [archives](/archives/).
M content/articles/log-jun-2009.textilecontent/articles/log-jun-2009.textile

@@ -1,13 +1,15 @@

----- permalink: log-jun-2009 +filters_pre: +- redcloth title: Personal Log - June 2009 +date: 2009-06-29 02:24:00 +02:00 tags: - personal_log - vim - ruby - wedding type: article -filter_pre: textile ----- Welcome to yet another of my extremely boring, excessively fragmented "personal log":/tags/personal_log posts. I'm seriously thinking of dropping the whole series in favor of more frequent (and shorter) blog posts, starting from next year. This means you'll probably have to read _another six_ of these priceless gems, until december 2009. As usual, feel free to skim through as each of the following _sections_ is almost completely unrelated to the others.h3. H3RALD Web Site v8.0
M content/articles/log-mar-2009.textilecontent/articles/log-mar-2009.textile

@@ -1,10 +1,12 @@

----- permalink: log-mar-2009 +filters_pre: +- redcloth title: Personal Log - March 2009 +date: 2009-03-30 06:04:00 +02:00 tags: - personal_log wedding ruby type: article -filter_pre: textile ----- Another month _without_ the Internet at home. This is getting really annoying, and I decided to change provider, *again*, hoping that I'll eventually get my broadband back, someday. Luckily I can still go online at work, but of course it's not the same thing: my time on Twitter and Facebook is now basically limited to weekends only, when Roxanne and I go down to Tuscany to stay with her parents.
M content/articles/log-may-2009.textilecontent/articles/log-may-2009.textile

@@ -1,10 +1,12 @@

----- permalink: log-may-2009 +filters_pre: +- redcloth title: Personal Log - May 2009 +date: 2009-05-31 06:35:00 +02:00 tags: - personal_log programming wedding type: article -filter_pre: textile ----- Yet another extremely busy month, as you can see from the total absence of blog posts and lack of tweets even. Things are getting pretty hectic at work now I guess: less people, more work, more responsibility, same money. They call it ??contingency??; it's the latest trend in the Western World, didn't you know? I'm really not impressed. I can't complain though I guess: I still enjoy my job very much and I know it could be much worse, so it's just a matter of enduring until autumn -- or so they say.
M content/articles/ma.gnolia.bbcodecontent/articles/ma.gnolia.bbcode

@@ -1,12 +1,14 @@

----- permalink: ma.gnolia +filters_pre: +- bbcode title: Ma.gnolia - Social bookmarking made (extremely) easy +date: 2006-03-04 13:53:33 +01:00 tags: - internet - review - web20 type: article -filter_pre: bbcode ----- Social Bookmarking[1] is not something [i]new[/i] anymore; in fact, some people say they've seen too much of it already (imagine that!). One of the worst things - or best, depending on your point of view - of the whole Web 2.0[2] hype is that everything evolves at least ten times faster than it did in good ol' Web 1.0 (if you let me use the term): there are [i]many, many more[/i] web pages created everyday by literally [i]anyone[/i], from web developers to total newcomers to the Web, to amateurs who just want to share their content because it's 'cool'. However, this is not a rant. Web 2.0 is inevitably going to become more and more user friendly, and you can't do anything about it. Why? Because it pays. Who's most likely to click on the flashy banner on page X featuring product Y not knowing that by doing so company Z will get a penny: your grandmother who is just now learning how to use the Internet or your brother who's majoring in computer science?
M content/articles/mongrel-shortcut-review.textilecontent/articles/mongrel-shortcut-review.textile

@@ -1,13 +1,15 @@

----- permalink: mongrel-shortcut-review +filters_pre: +- redcloth title: "Book Review: Mongrel Digital Shortcut" +date: 2007-12-15 03:42:00 +01:00 tags: - review - books - rails - ruby type: article -filter_pre: textile ----- If you ever considered about developing an deploying a Rails application in the last year or so, you must have heard of "Mongrel":http://mongrel.rubyforge.org/index.html before. If you didn't, I'd recommend you learn more about it because up to now it proved to be one of the few essential ingredients for deploying _scalable_ Rails applications.
M content/articles/next-generation-dvds.bbcodecontent/articles/next-generation-dvds.bbcode

@@ -1,12 +1,14 @@

----- permalink: next-generation-dvds +filters_pre: +- bbcode title: Next generation DVDs +date: 2005-12-10 12:53:46 +01:00 tags: - review - blueray - hd-dvd type: article -filter_pre: bbcode ----- Get a full comparative and analytical view of the HD-DVD and Blu-Ray disc formats. Why do we need them? Are they the perfect answer? Which one of them (if any...) will eventually take the throne? The answers to all these questions (and more) are inside! [b]The endless quest for space[/b]
M content/articles/obama-may-come-to-genoa.textilecontent/articles/obama-may-come-to-genoa.textile

@@ -1,10 +1,12 @@

----- permalink: obama-may-come-to-genoa +filters_pre: +- redcloth title: Barack Obama may visit Genoa (Italy) on October 12th +date: 2008-08-11 04:09:00 +02:00 tags: - politics type: article -filter_pre: textile ----- Barack Obama may visit Columbus' birthplace on October 12th 2008, and take part in the city's celebration of the discovery of America, which is held in the city every year. As reported by *Il Secolo XIX*, Genova's local newspaper.
M content/articles/pagerank.bbcodecontent/articles/pagerank.bbcode

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

----- permalink: pagerank +filters_pre: +- bbcode title: The Green Bar +date: 2005-12-09 14:03:54 +01:00 tags: - google - internet type: article -filter_pre: bbcode ----- Since 1998 SEO experts, webmasters, and even casual users spent ages trying to figure out the magic within that small green bar... but what's really behind Google's most famous invention?If you never experienced the sensation of looking at such a [i]green bar[/i] before, then maybe you don't know what I'm referring to; I suggest downloading and installing the Google Toolbar[1]. This IE add-on (now available for the Firefox browser) was developed by Google years ago and still remains the most common way to view a website's [b]PageRank[/b] through a simple bar with a variable length, according to a 10 point scale.
M content/articles/perfect-browser.bbcodecontent/articles/perfect-browser.bbcode

@@ -1,10 +1,12 @@

----- permalink: perfect-browser +filters_pre: +- bbcode title: The Perfect Browser +date: 2005-12-09 14:31:01 +01:00 tags: [] type: article -filter_pre: bbcode ----- So you finally decided to say goodbye to Internet Explorer, but now you feel lost in a multitude of browsers that all claim to be faster, more customizable, safer, or simply better than IE. Are they telling the truth? If so, which one is the perfect browser?[b]Point of view, clarifications and scope of this article[/b]
M content/articles/pre-review-of-ie7.bbcodecontent/articles/pre-review-of-ie7.bbcode

@@ -1,12 +1,14 @@

----- permalink: pre-review-of-ie7 +filters_pre: +- bbcode title: Pre-review of Internet Explorer 7 +date: 2005-11-25 18:16:46 +01:00 tags: - browsers - microsoft - ie type: article -filter_pre: bbcode ----- Internet Explorer 6.0 was officially released on August 27th 2001, and it still runs on millions of computers across the world: it's probably the browser release which has lasted the longest in the entire history of the Internet! While I'm not sure if this is an "achievement" so much as it is an "imposition", Uncle Bill admitted that his latest baby, Internet Explorer 7, is due soon...[b]In the Beginning[/b] Recently (5 months ago, that is) the aforementioned [i]"Microsoft Chairman and Chief Software Architect Bill Gates announced Internet Explorer 7.0, designed to add new levels of security to Windows XP Service Pack 2"[/i]. This happened at the RSA Conference in San Francisco, and although I wasn't there, I can imagine that amongst the oohs and ahhs of the crowd, someone must have whispered "It's about time".
M content/articles/project-gutenberg.bbcodecontent/articles/project-gutenberg.bbcode

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

----- permalink: project-gutenberg +filters_pre: +- bbcode title: "Project Gutenberg: The What, When and Why" +date: 2005-12-10 12:55:28 +01:00 tags: - writing - internet type: article -filter_pre: bbcode ----- I always liked reading Shakespeare, and I always wanted to have a copy of every one of his plays, tragedies and sonnets on my bookshelf ready for consultation, but such things always seemed unrealistic because I had neither the space for them nor the time to find them all nor the money to spend on them when I did find them. Now I can store the complete works of William Shakespeare directly on my mobile phone, and they take up as little as 1.4 MB compressed...
M content/articles/project-windstone.bbcodecontent/articles/project-windstone.bbcode

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

----- permalink: project-windstone +filters_pre: +- bbcode title: "CyberArmy Presents: Project WindStone" +date: 2005-12-10 12:59:23 +01:00 tags: - internet - open-source type: article -filter_pre: bbcode ----- I think most of the people who currently use the Internet have tried Microsoft Hotmail[1] at least once. Many of you probably don't use it anymore because you found something better, but the point is that Hotmail has been around for a long time, and so has its authentication method, MSN Passport, which is a universal login system used not only for Hotmail but also for many other non-Microsoft websites and services. If you don't like the idea of using Microsoft-owned technology as an authentication system, we have an alternative for you... [b]Show me your Passport[/b]
M content/articles/quick-overview-of-sqlite.bbcodecontent/articles/quick-overview-of-sqlite.bbcode

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

----- permalink: quick-overview-of-sqlite +filters_pre: +- bbcode title: A Quick Overview of SQLite +date: 2005-11-25 17:52:38 +01:00 tags: - review - databases type: article -filter_pre: bbcode ----- A few months ago, my old hosting company started having problems with their servers. The servers would go down unexpectedly for 5-10 minutes on a relatively frequent basis, but for some weird reason... the MySQL databases were unusable for a couple of hours afterwards every time. "We had problems with MySQL, BUT the server was up, so we're still within the 99% uptime guarantee"... At the time I was thinking: "If only MySQL databases behaved like plain files..."
M content/articles/rails-doc-first-look.textilecontent/articles/rails-doc-first-look.textile

@@ -1,10 +1,12 @@

----- permalink: rails-doc-first-look +filters_pre: +- redcloth title: Rails-Doc.org - A First Look +date: 2008-06-19 07:30:00 +02:00 tags: - rails ruby writing review type: article -filter_pre: textile ----- When you decided to learn Ruby on Rails (if you did, that is), chances are that you bought a book. I did, too, actually: there are a lot of very interesting and fairly comprehensive books out there after all.
M content/articles/rails-inspired-php-frameworks.textilecontent/articles/rails-inspired-php-frameworks.textile

@@ -1,13 +1,15 @@

----- permalink: rails-inspired-php-frameworks +filters_pre: +- redcloth title: Rails-inspired PHP frameworks +date: 2006-05-03 14:57:00 +02:00 tags: - frameworks - review - cakephp - rails type: article -filter_pre: textile ----- 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/articles/rails-os-killer-apps.textilecontent/articles/rails-os-killer-apps.textile

@@ -1,13 +1,15 @@

----- permalink: rails-os-killer-apps +filters_pre: +- redcloth title: Rails-powered Open Source Killer Apps, Anyone? +date: 2008-11-02 10:41:00 +01:00 tags: - rails - ruby - writing - rant type: article -filter_pre: textile ----- Lately I've been meandering around the web to find a good CMS for a family site I'd like to set up. Why a CMS? Well, for a few simple reasons:
M content/articles/rails-to-italy.textilecontent/articles/rails-to-italy.textile

@@ -1,10 +1,12 @@

----- permalink: rails-to-italy +filters_pre: +- redcloth title: Rails to Italy 2007 +date: 2007-07-07 13:15:00 +02:00 tags: - rails italy type: article -filter_pre: textile ----- So it looks like there will be a "Rails conference in Italy", after all. In Pisa as well, and that's maybe even less than 2 hours drive from where I live (Genoa)!
M content/articles/rawline-020.textilecontent/articles/rawline-020.textile

@@ -1,10 +1,12 @@

----- permalink: rawline-020 +filters_pre: +- redcloth title: "New Release: RawLine 0.2.0" +date: 2008-04-02 05:33:00 +02:00 tags: - ruby programming opensource rawline type: article -filter_pre: textile ----- -InLine- RawLine 0.2.0 is out!
M content/articles/rawline-030.textilecontent/articles/rawline-030.textile

@@ -1,10 +1,13 @@

----- permalink: rawline-030 +filters_pre: +- erb +- redcloth title: "RawLine 0.3.0 released \xC3\xA2\xE2\x82\xAC\xE2\x80\x9D now with Readline emulation" +date: 2009-03-01 07:47:00 +01:00 tags: - ruby opensource rawline type: article -filter_pre: textile ----- "RawLine":/rawline 0.3.0 has been "released":http://rubyforge.org/projects/rawline. This new milestones fixes some minor bugs and adds some new functionalities, must notably:

@@ -16,7 +19,7 @@ Some of you asked for Readline compatibility/emulation and that was actually not too difficult to implement: all the bricks were already there, I just had to put them together in the right place.

The @RawLine@ module (you can spell it "Rawline" as well, if you wish) now behaves like @Readline@. This means that you can now use RawLine like this (taken from examples/readline_emulation.rb): -<typo:code lang="ruby"> +<% highlight :ruby do %> include Rawline puts "*** Readline Emulation Test Shell ***"

@@ -30,11 +33,11 @@

loop do puts "You typed: [#{readline("=> ", true).chomp!}]" end -</typo:code> +<% end %> Basically you get a @readline@ method, a @HISTORY@ constant like the one exposed by Readline (Rawline's is a RawLine::HistoryBuffer object though &mdash; much more manageable), and a @FILENAME_COMPLETION_PROC@ constant, which provides basic filename completion. Here it is: -<typo:code lang="ruby"> +<% highlight :ruby do %> def filename_completion_proc lambda do |word| dirs = @line.text.split('/')

@@ -48,7 +51,7 @@ end

Dir.entries(dir).select { |e| (e =~ /^\./ && @match_hidden_files && word == '') || (e =~ /^#{word}/ && e !~ /^\./) } end end -</typo:code> +<% end %> You can find this function as part of the @RawLine::Editor@ class. The result is not exactly the same Readline, because completion matches are not displayed underneath the line but inline and can be cycled through &mdash; which is one of Readline's completion modes anyway.
M content/articles/real-world-rawline-usage.textilecontent/articles/real-world-rawline-usage.textile

@@ -1,10 +1,13 @@

----- permalink: real-world-rawline-usage +filters_pre: +- erb +- redcloth title: Real-world Rawline usage +date: 2009-03-07 04:54:00 +01:00 tags: - ruby rawline type: article -filter_pre: textile ----- So I finally decided to update "RawLine":/rawline last week, and I added a more Readline-like API. When I first started the project, I was determined _not_ to do that, because the current Readline wrapper shipped with Ruby is not very Ruby-ish: it's a wrapper, after all!

@@ -21,7 +24,7 @@ * you can't type certain characters if they use some key modifiers like <RIGHT-ALT>, etc.

RawLine doesn't have these problems (that's the very reason why I created it), so here's a simple script which launches a Rawline-enabled Rush shell: -<typo:code lang="ruby"> +<% highlight :ruby do %> require 'rubygems' require 'rush' require 'rawline'

@@ -46,7 +49,7 @@ end

end shell = RawlineRush.new.run -</typo:code> +<% end %> What happens here? Nothing much really, all I had to do was:

@@ -63,7 +66,7 @@

After trying out Rush, the next logical step was trying IRB itself: I could never use it properly on Windows, and that was really frustrating. After a few minutes trying to figure out how to start IRB programmatically, I quickly came up with a similar example: -<typo:code lang="ruby"> +<% highlight :ruby do %> require 'irb' require 'irb/completion' require 'rubygems'

@@ -90,7 +93,7 @@ module IRB

@CONF[:SCRIPT] = RawlineInputMethod.new end IRB.start -</typo:code> +<% end %> In this case, Rawline is included in the <code>RawlineInputMethod</code> class, derived from the original <code>ReadlineInputMethod</code> class, i.e. the class IRB uses to define (guess...) how to input characters. Again, all I had to do was set a few Rawline variables to match the ones used in Readline, and then redefine the function used to get characters. All done.
M content/articles/redbook-020-released.textilecontent/articles/redbook-020-released.textile

@@ -1,10 +1,12 @@

----- permalink: redbook-020-released +filters_pre: +- redcloth title: "Announcement: RedBook v0.2.0 released" +date: 2007-10-08 05:05:00 +02:00 tags: - redbook ruby productivity opensource type: article -filter_pre: textile ----- <blockquote> _"Release Early, Release Often"_
M content/articles/redbook-030-released.textilecontent/articles/redbook-030-released.textile

@@ -1,10 +1,12 @@

----- permalink: redbook-030-released +filters_pre: +- redcloth title: "Announcement: RedBook v0.3.0 released" +date: 2007-10-25 07:18:00 +02:00 tags: - redbook ruby productivity opensource type: article -filter_pre: textile ----- It's time for a new beta release of RedBook. This was actually going to be a fairly modest release in terms of features, but I actually ended up implementing a lot more than expected, even things which were planned for the first production release 1.0. So, let's see what's new
M content/articles/redbook-040-released.textilecontent/articles/redbook-040-released.textile

@@ -1,10 +1,12 @@

----- permalink: redbook-040-released +filters_pre: +- redcloth title: "Announcement: RedBook v0.4.0 released" +date: 2007-11-28 08:34:00 +01:00 tags: - opensource productivity redbook ruby type: article -filter_pre: textile ----- I'm pleased to announce a new release of the RedBook daily logging and time tracking script. This release introduces two new operations, four stats-related directives and a brand new Windows Installer able to setup RedBook in a blink, with (almost) no configuration at all.
M content/articles/redbook-050-released.textilecontent/articles/redbook-050-released.textile

@@ -1,10 +1,13 @@

----- permalink: redbook-050-released +filters_pre: +- erb +- redcloth title: "Announcement: RedBook v0.5.0 released" +date: 2007-12-16 08:07:00 +01:00 tags: - opensource productivity redbook ruby type: article -filter_pre: textile ----- This new beta release of RedBook introduces quite a few changes when it comes to configuration and setup. Here's some highlights...h3. Regexp changes

@@ -25,7 +28,7 @@

:var_friday_evening: "friday at 8 pm" :var_week_report: ":select :duration :from :%monday_morning :to :%friday_evening" -</typo:code> +<% end %> In this way, every time you type in :%week_report in RedBook, it will expand to: @:select :duration :from monday at 8 am :to friday at 8 pm@. By the way, completion is supported, so you'll only have to type in something like @:%we@ and hit <tab>.
M content/articles/redbook.textilecontent/articles/redbook.textile

@@ -1,10 +1,12 @@

----- permalink: redbook +filters_pre: +- redcloth title: RedBook - A simple Ruby program for your daily logging needs +date: 2007-09-29 14:05:00 +02:00 tags: - ruby productivity software tools redbook type: article -filter_pre: textile ----- Logging your daily activities is important. If you don't believe me you'd better check at least these three posts on LifeHacker, which feature different scripts and applications:
M content/articles/review-services.textilecontent/articles/review-services.textile

@@ -1,6 +1,9 @@

----- permalink: review-services +filters_pre: +- redcloth title: Review Services +date: 2007-12-14 12:24:00 +01:00 tags: - review - website

@@ -8,7 +11,6 @@ - personal

- tools - books type: article -filter_pre: textile ----- When it comes to software, I definitely like to try out new things. My collegues takes the piss out of me because every -week- day I come up with "some new tool they _have_ to start using" and so on. As a matter of fact, I like reviewing software as well. I enjoy writing and analyzing new things, evaluating all the new possibilities they may offer, and I also tend to have a rather critical eye for what doesn't _feel_ right. I'll use a tool for months but still try out new ones which claim to do the same thing — but better — as they come out.
M content/articles/ror-and-cakephp.textilecontent/articles/ror-and-cakephp.textile

@@ -1,12 +1,14 @@

----- permalink: ror-and-cakephp +filters_pre: +- redcloth title: Ruby on Rails & CakePHP +date: 2006-07-07 09:52:28 +02:00 tags: - cakephp - rails - tutorial type: article -filter_pre: textile ----- This article is an attempt to port a famous Ruby on Rails tutorial to PHP using an emerging PHP MVC framework, CakePHP. CakePHP was inspired by Rails' philosophy of Rapid Application Development. It implements a lot of the features and concepts that made Ruby on Rails popular in a very short time. Although Ruby's syntax and way of doing things is known to be much more elegant than other programming languages, there is yet hope for PHP to get more organized and effi cient. This tutorial will follow its Rails counterpart step-by-step, covering the essential steps to create a simple, yet fully functional, web application. Register on the "International PHP Magazine":http://www.php-mag.net/magphpde/psecom,id,20,archive,2,noeid,20,.html to read the full article.
M content/articles/ruby-facets.textilecontent/articles/ruby-facets.textile

@@ -1,10 +1,13 @@

----- permalink: ruby-facets +filters_pre: +- erb +- redcloth title: A glance at Ruby facets +date: 2007-07-01 12:11:00 +02:00 tags: - ruby review programming type: article -filter_pre: textile ----- _"Code is poetry"._

@@ -22,7 +25,7 @@

Forget semicolons, you'll never use one ever again in Ruby, as there's no need to add them at the end of each line. Same goes with those annoying curly brackets: they are just used for delimiting hashes and blocks (more on all this later on). Ruby uses _def_ and _end_ keywords instead: you'll never believe how this does _not_ add unnecessary verbosity to your code, but rather helps you manage it. This is a relief for me especially, because on Italian keyboards you have to press Alt Gr+SHIFT+&egrave; to get an open curly bracket, which says it all. So let's take a look at our first silly Ruby function, shall we? -<typo:code lang="ruby"> +<% highlight :ruby do %> def hello(name=nil) if name then print 'Hello, '+name+'!'

@@ -30,7 +33,7 @@ else

print 'Hello!' end end -</typo:code> +<% end %>
M content/articles/ruby-lang-italian.textilecontent/articles/ruby-lang-italian.textile

@@ -1,10 +1,12 @@

----- permalink: ruby-lang-italian +filters_pre: +- redcloth title: Italian translation of Ruby-Lang.org finally available! +date: 2008-11-15 14:48:00 +01:00 tags: - ruby type: article -filter_pre: textile ----- "[Vai alla versione italiana]":#italian-version
M content/articles/ruby-thanks.textilecontent/articles/ruby-thanks.textile

@@ -1,10 +1,12 @@

----- permalink: ruby-thanks +filters_pre: +- redcloth title: Thanks +date: 2007-09-14 11:43:00 +02:00 tags: - ruby writing internet type: article -filter_pre: textile ----- It looks like my "last article":/articles/ten-reasons-to-learn-ruby was not too bad after all. Quite a few thousands of people ended up reading it since it was published nearly 10 days ago: not too bad.
M content/articles/server-packages.bbcodecontent/articles/server-packages.bbcode

@@ -1,13 +1,15 @@

----- permalink: server-packages +filters_pre: +- bbcode title: Easy-to-install server packages +date: 2005-06-28 22:12:19 +02:00 tags: - review - web-development - php - databases type: article -filter_pre: bbcode ----- The first and most obvious difference between, say, a C++ programmer and a PHP developer is that the PHP developer needs a server with PHP support up and running somewhere in order to "show" others that the application is working. This normally means that a PHP developer must either have remote access to a server, or have one set up on his machine. Installing and configuring a server can be tricky sometimes, especially if you want to configure it "properly", but in some cases - for Linux/BSD users mainly - there are some pre-configured servers you can download and install.
M content/articles/simply-on-rails-1-concepts-map.textilecontent/articles/simply-on-rails-1-concepts-map.textile

@@ -1,10 +1,12 @@

----- permalink: simply-on-rails-1-concepts-map +filters_pre: +- redcloth title: "Simply on Rails - Part 1: Concepts and Bubbles" +date: 2007-07-07 07:43:00 +02:00 tags: - rails website web20 type: article -filter_pre: textile ----- The first thing I do when I start developing a new application is write down some ideas.
M content/articles/simply-on-rails-2-database-design.textilecontent/articles/simply-on-rails-2-database-design.textile

@@ -1,10 +1,12 @@

----- permalink: simply-on-rails-2-database-design +filters_pre: +- redcloth title: "Simply on Rails - Part 2: Database Design" +date: 2007-07-14 11:27:00 +02:00 tags: - rails databases type: article -filter_pre: textile ----- This week I attended a course for work on how to _Implement Databases with Microsoft SQL Server 2005_. An interesting course indeed, which made me realize how feature-rich Bill's product is, compared to the Open Source alternatives like MySQL. It also made me realize how nice it is to implement database-related logic (read: Models) using a _proper_ programming language rather than using triggers, stored procedures, functions and other goodies offered by Transact-SQL.
M content/articles/simply-on-rails-3-shared-controller.textilecontent/articles/simply-on-rails-3-shared-controller.textile

@@ -1,16 +1,19 @@

----- permalink: simply-on-rails-3-shared-controller +filters_pre: +- erb +- redcloth title: "Simply on Rails - Part 3: LiteController" +date: 2007-07-22 06:03:00 +02:00 tags: - rails type: article -filter_pre: textile ----- Enough with concepts, ideas and diagrams: it's time to start coding something. Everyone knows what's the first step when creating a Rails applications, but anyhow, here it is: -<typo:code lang="ruby"> +<% highlight :ruby do %> rails italysimply -</typo:code> +<% end %> Then I create a new development database, load it up with the schema I "previously":/blog/simply-on-rails-2-database-design prepared and modify the @config/database.yml@ to be able to connect to it. Nothing new here. I actually had to modify the schema a little bit:

@@ -39,7 +42,7 @@

Here's the controller: %{color:red}*app/controllers/admin/lite_controller.rb*% -<typo:code lang="ruby"> +<% highlight :ruby do %> class Admin::LiteController < ApplicationController layout 'admin'

@@ -98,32 +101,32 @@ render('lite/edit')

end end end -</typo:code> +<% end %> Then all I need to do is create eight controllers with just a few lines of code in each: %{color:red}*app/controllers/admin/statuses_controller.rb*% -<typo:code lang="ruby"> +<% highlight :ruby do %> class Admin::StatusesController < Admin::LiteController def model Status end end -</typo:code> +<% end %> Basically, I just need to specify which model the specific controller takes care of, Ruby's inheritance does the rest. The model name will be passed to the views like this: %{color:red}*app/controllers/admin/lite_controller.rb*% -<typo:code lang="ruby"> +<% highlight :ruby do %> def prepare @item_name = model.to_s end -</typo:code> +<% end %> And each method uses the @model@ method to access the model, like this: %{color:red}*app/controllers/admin/lite_controller.rb*% -<typo:code lang="ruby"> +<% highlight :ruby do %> def create @item = model.new(params[:"#{@item_name.downcase}"]) if @item.save

@@ -133,20 +136,20 @@ else

render('lite/new') end end -</typo:code> +<% end %> Note how the params are collected: -<typo:code lang="ruby"> +<% highlight :ruby do %> @item = model.new(params[:"#{@item_name.downcase}"]) -</typo:code> +<% end %> @params[:"#{@item_name.downcase}"]@ at runtime becomes @params[:status]@ or @params[:role]@ etc. etc., depending on which controller is called. Sweet. The views? Modified accordingly: %{color:red}*app/views/lite/edit.rb*% -<typo:code lang="ruby"> +<% highlight :ruby do %> <h1>Editing <%= @item_name %></h1> <% form_tag :action => 'update', :id => @item do %>

@@ -156,10 +159,10 @@ <% end %>

<%= link_to 'Show', :action => 'show', :id => @item %> | <%= link_to 'Back', :action => 'list' %> -</typo:code> +<% end %> %{color:red}*app/views/lite/_form.rb*% -<typo:code lang="ruby"> +<% highlight :ruby do %> <%= error_messages_for 'item' %> <!--[form:lite]--> <p><label for="<%= @item_name.downcase %>_name">Name: </label>

@@ -169,4 +172,4 @@ <p><label for="<%= @item_name.downcase %>_level">Level: </label>

<%= text_field @item_name.downcase, 'level', {:value => @item.level} %></p> <% end %> <!--[eoform:lite]--> -</typo:code> +<% end %>
M content/articles/simply-on-rails-4-default-data-migrations.textilecontent/articles/simply-on-rails-4-default-data-migrations.textile

@@ -1,10 +1,13 @@

----- permalink: simply-on-rails-4-default-data-migrations +filters_pre: +- erb +- redcloth title: "Simply On Rails - Part 4: Quick and Easy Default Data Migrations" +date: 2007-09-15 13:10:00 +02:00 tags: - rails ruby databases type: article -filter_pre: textile ----- In the "last post":http://www.h3rald.com/blog/simply-on-rails-3-shared-controller of this series I tried to find a DRY(Don't Repeat Yourself) solution to deal with tables storing "ancillary" data, i.e. names of user roles, predefined categories, page state names and other similar things. I personally chose to put this kind of data to make my application more dynamic, although I could have decided to use ENUMs or simply ordinary varchar fields -- that would have been easier, but less flexible. For now, I'm sticking with my original choice.

@@ -16,7 +19,7 @@ All you have to do is create a migration to load the specified YAML files and you're all set.

I wanted to take a little step further, allowing the migration to load data from _all YAML files in a specific directory_, automatically.Let's start creating the YAML files then and place them all in one directory of the application like @/db/migrate/defaults@. Here's the one I used for user roles, for example: -<typo:code lang="yaml"> +<% highlight :yaml do %> visitor: id: 1 name: Visitor

@@ -51,13 +54,13 @@ webmaster:

id: 7 name: Webmaster level: 1000 -</typo:code> +<% end %> The important thing to remember is to provide a unique string to identify each record, before specifying each fiels. The other files look similar, so I won't bother listing them here. And here's the simple code for the migration: -<typo:code lang="ruby"> +<% highlight :ruby do %> require 'active_record/fixtures' class LoadDefaults < ActiveRecord::Migration

@@ -92,7 +95,7 @@ end

end end -</typo:code> +<% end %> Basically the migration will look in a directory named "defaults" for some YAML files named after a particular database table, and it will attempt to load all the records defined in each one of them. The @down@ method of the migration _deletes all the data in the specified tables_, so use with care...
M content/articles/simply-on-rails-intro.textilecontent/articles/simply-on-rails-intro.textile

@@ -1,10 +1,12 @@

----- permalink: simply-on-rails-intro +filters_pre: +- redcloth title: Simply on Rails? +date: 2007-06-30 06:00:00 +02:00 tags: - " rails web20" type: article -filter_pre: textile ----- So finally my site is back up, I don't have to worry about coding anymore: just writing about whatever I like, no more Cake, no more MVC, no more frameworks...
M content/articles/slax.bbcodecontent/articles/slax.bbcode

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

----- permalink: slax +filters_pre: +- bbcode title: Slax - A small, complete and 'nice-looking' Linux live distribution +date: 2006-02-05 17:17:46 +01:00 tags: - linux - review type: article -filter_pre: bbcode ----- How can I learn how to use Linux? Simple, you grab a copy of any of the twelve thousands different 'distros' available out there, and you install it on your PC, hoping not to damage your existing Windows installation (if any). Or there's a more lazy and safe way, get one of the few dozens of 'Linux live CDs', burn the cd, boot from it, and you're all set...It's true, nowadays the best solutions for Linux newbies is trying out a few [i]live CDs[/i] before installing [i]the real deal[/i] on their machines: it's safe(r), takes less time and it's much more fun. Yes, some people may object saying that the fun in learning Linux is installing it on your hard drive first, but a few people I know who 'accidentally' overwrote their Master Boot Record or 'accidentally' damaged their Windows installation might disagree there...
M content/articles/social-bookmarking-services.textilecontent/articles/social-bookmarking-services.textile

@@ -1,12 +1,14 @@

----- permalink: social-bookmarking-services +filters_pre: +- redcloth title: Review of ten popular social bookmarking services +date: 2006-05-13 15:06:27 +02:00 tags: - web20 - review - internet type: article -filter_pre: textile ----- Social bookmarking[1] is perhaps one of the pillars of Web 2.0, allowing people to save, tag and share their Internet bookmarks online anytime, anywhere. Since _del.icio.us_[2] came out, the Web is not the same anymore: no more IE favourites or Firefox bookmarks, no more "Save page as..." etc., people nowadays want to do _everything_ online without being bond to a single computer, and also make everything they do or read public - apparently. This is one of the key concepts of Web 2.0[3]: sharing information in a quick and easy way, without any restrictions.Del.icio.us was the first, but of course not the only one social bookmarking system which became popular in a few months: many other followed its example, many companies developed their own alternative to del.icio.us, adding and removing features, changing bits etc. etc. Result: someone said that _"[...] There is almost 1 new social bookmark/digg like service appears one daily basis [...]"_[4].
M content/articles/sqlyog5-review.bbcodecontent/articles/sqlyog5-review.bbcode

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

----- permalink: sqlyog5-review +filters_pre: +- bbcode title: SQLyog 5 - a fast and reliable MySQL front-end +date: 2006-02-28 13:50:00 +01:00 tags: - databases - review type: article -filter_pre: bbcode ----- MySQL[1] is a great database solution. Literally millions of people who use it can tell you that it is a well-performing, feature-rich database solution for almost any size project: it is low-cost (often free), and available on the majority of webservers all over the world. When I first discovered MySQL while learning some basic PHP programming, I almost immediately wondered how I'd effectively access MySQL and manage my databases other than through PHP code or command line. I was pointed to PHPMyAdmin[2], which I still use as a quick, general-purpose MySQL front-end. However, I wondered if there was anything better than that, and maybe not confined within a browser window...
M content/articles/textlinkads_sidebar_v01.textilecontent/articles/textlinkads_sidebar_v01.textile

@@ -1,10 +1,12 @@

----- permalink: textlinkads_sidebar_v01 +filters_pre: +- redcloth title: Text Link Ads sidebar for Typo +date: 2007-11-17 04:47:00 +01:00 tags: - rails opensource type: article -filter_pre: textile ----- I thought it would be nice to share the code of the sidebar I created to display "Text Link Ads":http://www.text-links-ads.com sponsor links on my Typo powered blog.
M content/articles/the-internet-philosopher.textilecontent/articles/the-internet-philosopher.textile

@@ -1,12 +1,14 @@

----- permalink: the-internet-philosopher +filters_pre: +- redcloth title: The Internet Philosopher +date: 2006-05-11 13:00:41 +02:00 tags: - internet - writing - travelling type: article -filter_pre: textile ----- Recently I got this rather short email from a guy named Daniel Lampinen:
M content/articles/the-rails-way-review.markdown smartypantscontent/articles/the-rails-way-review.markdown

@@ -1,12 +1,14 @@

----- permalink: the-rails-way-review +filters_pre: +- bluecloth title: "Book Review: The Rails Way" +date: 2009-01-04 09:03:00 +01:00 tags: - rails - books - review type: article -filter_pre: markdown smartypants ----- > "Programming books are pointless: you buy them, you read them and you chuck them because they're already out-of-date!"
M content/articles/thoughts-on-firefox3-and-opera95.textilecontent/articles/thoughts-on-firefox3-and-opera95.textile

@@ -1,10 +1,12 @@

----- permalink: thoughts-on-firefox3-and-opera95 +filters_pre: +- redcloth title: Thoughts on Firefox 3 and Opera 9.5 +date: 2008-06-13 05:18:00 +02:00 tags: - browsers review firefox opera type: article -filter_pre: textile ----- Opera 9.5 is out, Firefox 3 too (more or less), so, which browser are you going to use today? This new generatio of browsers offers plenty of new, innovative features and improvements over the past, in both cases:
M content/articles/to-rest-or-not-to-rest.textilecontent/articles/to-rest-or-not-to-rest.textile

@@ -1,10 +1,12 @@

----- permalink: to-rest-or-not-to-rest +filters_pre: +- redcloth title: To REST or not to REST? +date: 2007-09-24 05:48:00 +02:00 tags: - rails type: article -filter_pre: textile ----- Lately I've been reading quite a bit about Rails' REST approach, and to be totally honest I'm not 100% convinced it can always be a good idea. The purpose of this post is to re-evaluate the situation, and ask other people their opinion on the matter.
M content/articles/too-many-cooks-take-2.textilecontent/articles/too-many-cooks-take-2.textile

@@ -1,10 +1,12 @@

----- permalink: too-many-cooks-take-2 +filters_pre: +- redcloth title: "Too many cooks... take #2" +date: 2007-09-02 06:41:00 +02:00 tags: - cakephp writing rant type: article -filter_pre: textile ----- Today I was not going to post on my blog. I have the flu, I don't feel very well so I started reading some news feeds on Google Reader. That lasted for about half an hour, so I decided to check my old Netvibes account where I kept other feeds, including a bunch of CakePHP-related blogs.
M content/articles/tweaking-windows-explorer.textilecontent/articles/tweaking-windows-explorer.textile

@@ -1,12 +1,14 @@

----- permalink: tweaking-windows-explorer +filters_pre: +- redcloth title: Tweaking Windows Explorer +date: 2007-06-29 11:28:00 +02:00 tags: - windows - review - software type: article -filter_pre: textile ----- If you asked me what file manager I used on Windows, up to a month ago I'd have answered something like: "A43":http://www.primitus.us/a43/ or "CubicExplorer":http://www.cubicreality.com/, for sure _anything but Windows Explorer_. Well, it turns out that I had to change my mind after all...
M content/articles/web-promotion.bbcodecontent/articles/web-promotion.bbcode

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

----- permalink: web-promotion +filters_pre: +- bbcode title: Zero-cost website promotion - Part I +date: 2005-12-09 14:08:27 +01:00 tags: - internet - web-development type: article -filter_pre: bbcode ----- Everybody from magazines to canned pasta sellers wants a website to promote their business, but you need to promote your site before you promote your products or services through it. In Part 1 of this article, I will explain some of the basics of promoting a website, and show you how to implement a cost-free strategy to get the search engine placement you need to promote your website.[b]The Necessity of Website Promotion[/b] As the World Wide Web kept growing over the years, people soon realised that keeping updated [i]list[/i]s of all the available pages on the Net was an impossible and pointless job. It became necessary to develop a new way to easily find and access the massive amount of content on the Web, and that is when [i]search engines[/i] became a reality.
M content/articles/what-is-ajax.bbcodecontent/articles/what-is-ajax.bbcode

@@ -1,13 +1,15 @@

----- permalink: what-is-ajax +filters_pre: +- bbcode title: What is AJAX? +date: 2006-01-12 07:30:08 +01:00 tags: - internet - web20 - ajax - web-development type: article -filter_pre: bbcode ----- [i]"The Web is changing. The 30-year-old terminal-like technology it was originally is gradually giving way to new ways of doing things. The power of AJAX allows for rich user interaction without the trouble that has bugged traditional web applications."[/i]This is the introduction to the script.aculo.us[1] website, and regardless your opinion about the so-called AJAX [i]programming technique[/i], they are fundamentally right: the web is changing. AJAX is at least one way to do things in a different way, enhancing - although arguably, in some cases - users' browsing experience.
M content/articles/where-does-your-ruby-code-live.textilecontent/articles/where-does-your-ruby-code-live.textile

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

----- permalink: where-does-your-ruby-code-live +filters_pre: +- redcloth title: Where does your Ruby code live? +date: 2008-11-08 13:34:00 +01:00 tags: - ruby - programming type: article -filter_pre: textile ----- Back when I wrote my "10 reasons to learn Ruby":/articles/10-reasons-to-learn-ruby article, I mentioned "RubyGems":http://www.rubygems.org/ in _Reason #1_ as one of they key features of the Ruby programming languages. Indeed, gems make getting Ruby programs as easy as typing @gem install <something>@ from the command line. When you want to distribute something new in Ruby, there's no need to give people download links, zip files or setup programs, just "tell them to get the gem":http://adam.blog.heroku.com/past/2008/11/2/pony_the_express_way_to_send_email_from_ruby/. That's perfectly normal, and extremely cool.
M content/bio.textilecontent/bio.textile

@@ -1,10 +1,12 @@

----- permalink: bio +filters_pre: +- redcloth title: About Fabio Cevasco +date: tags: [] type: page -filter_pre: textile ----- !>http://www.h3rald.com/img/author_fabio_cevasco.jpg!
M content/code.textilecontent/code.textile

@@ -1,10 +1,12 @@

----- permalink: code +filters_pre: +- redcloth title: Code +date: tags: [] type: page -filter_pre: textile ----- Available Open Source programs and scripts:
M content/concatenative.textilecontent/concatenative.textile

@@ -1,10 +1,13 @@

----- permalink: concatenative +filters_pre: +- erb +- redcloth title: Concatenative +date: 2009-03-28 07:21:00 +01:00 tags: [] type: page -filter_pre: textile ----- h2. Concatenative

@@ -27,13 +30,13 @@ h3. Usage

Initialization: -<typo:code lang="ruby"> +<% highlight :ruby do %> require 'concatentive' -</typo:code> +<% end %> Execute a Concatenative program: -<typo:code lang="ruby"> +<% highlight :ruby do %> concatenate( 10, [0, :==],

@@ -42,14 +45,14 @@ [:dup, 1, :-],

[:*], :linrec ) -</typo:code> +<% end %> The program above returns the factorial of 10, computed using the linrec combinator. It is also possible to execute arrays directly and define concatenative programs as symbols. -<typo:code lang="ruby"> +<% highlight :ruby do %> :factorial << [[0, :==], [:pop, 1], [:dup, 1, :- , :factorial, :*], :if] [5, :factorial].execute -</typo:code> +<% end %> The program above calculates the factorial of 5, using explicit recursion.

@@ -61,11 +64,11 @@ * If a method has a different arity, you must specify it explicitly using the pipe (|) operator.

Example: -<typo:code lang="ruby"> +<% highlight :ruby do %> concatenate( "Goodbye, World!", /Goodbye/, "Hello", :sub|2 ) -</typo:code> +<% end %> The program above is equivalent to "Goodbye, World!".sub(/Goodbye/, "Hello").
M content/contact.textilecontent/contact.textile

@@ -1,10 +1,12 @@

----- permalink: contact +filters_pre: +- redcloth title: Contact +date: tags: [] type: page -filter_pre: textile ----- If you need to contact me, feel free to write an email to *h3rald [at] h3rald.com*.
M content/herald-vim-color-scheme.textilecontent/herald-vim-color-scheme.textile

@@ -1,10 +1,12 @@

----- permalink: herald-vim-color-scheme +filters_pre: +- redcloth title: herald.vim +date: 2009-06-23 08:20:01 +02:00 tags: [] type: page -filter_pre: textile ----- h2. herald.vim
M content/holidays.textilecontent/holidays.textile

@@ -1,10 +1,12 @@

----- permalink: holidays +filters_pre: +- redcloth title: Holidays +date: 2009-03-22 06:50:29 +01:00 tags: [] type: page -filter_pre: textile ----- h2. Holiday House in Sessarego (GE), Italy
M content/home.textilecontent/home.textile

@@ -1,10 +1,12 @@

----- permalink: home +filters_pre: +- redcloth title: Home +date: tags: [] type: page -filter_pre: textile ----- Welcome to H3RALD.com, Fabio Cevasco's personal web site. ---
D content/home1.textile

@@ -1,51 +0,0 @@

------ -title: Home - ------ -<div class="panel" id="home"> - -h2. Home - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut diam orci, consequat a varius sed, malesuada in leo. Donec non urna a risus bibendum aliquam. Ut luctus, diam sed faucibus iaculis, diam diam bibendum massa, non adipiscing ligula diam facilisis tortor. Suspendisse potenti. Maecenas auctor tristique hendrerit. Aenean vestibulum dolor ut lorem hendrerit in tempus orci sagittis. Nullam pretium suscipit malesuada. Pellentesque in sodales ante. Integer a pulvinar est. Nullam sodales, tellus scelerisque eleifend tincidunt, lectus massa fringilla enim, non sodales mauris enim vel lectus. Nulla facilisi. Nam semper mollis vulputate. Curabitur et dolor mauris, quis aliquam ipsum. Quisque a sem diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Nullam semper, magna sed porttitor posuere, ante orci pulvinar odio, vel pellentesque nibh quam eu risus. - -Maecenas ut erat et tortor luctus iaculis id congue orci. Nulla condimentum enim eleifend nibh ornare tincidunt. Morbi euismod erat in enim vulputate sagittis. Sed luctus sagittis commodo. Maecenas hendrerit orci quis mauris ornare venenatis. Pellentesque congue augue non massa pharetra tempus. In hac habitasse platea dictumst. Sed porta molestie orci vel semper. Pellentesque sed congue est. Mauris sed orci vel leo feugiat faucibus et sed nisl. Nullam purus elit, aliquam sed tempor sit amet, lacinia tincidunt massa. Cras orci libero, lobortis sed gravida quis, tristique ac ligula. Curabitur suscipit malesuada justo ut elementum. - -Fusce eget nibh at urna suscipit mollis sed ut purus. Curabitur et augue est. Maecenas vulputate vestibulum mi vitae aliquet. Morbi egestas pulvinar nibh, quis gravida quam hendrerit eu. Integer quis condimentum neque. Donec ultricies sodales dui vitae porta. Suspendisse lobortis elit id sapien accumsan quis posuere libero mollis. Quisque interdum neque vitae tellus pulvinar dignissim. Nam consectetur orci non leo pretium ut viverra nisl sodales. Etiam eu pellentesque enim. Etiam in massa augue. Nunc quis arcu orci, eget feugiat purus. Suspendisse nec lorem lacus, vitae commodo lorem. Nulla vulputate mi et eros venenatis tincidunt. In mollis neque sit amet leo facilisis convallis vestibulum nibh aliquam. Cras sagittis dui sed dolor facilisis cursus. Maecenas condimentum vestibulum condimentum. Suspendisse molestie tempus arcu eget aliquet. Fusce quis quam at orci faucibus imperdiet. - -</div> -<div class="panel" id="tags"> - -h2. Tags - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut diam orci, consequat a varius sed, malesuada in leo. Donec non urna a risus bibendum aliquam. Ut luctus, diam sed faucibus iaculis, diam diam bibendum massa, non adipiscing ligula diam facilisis tortor. Suspendisse potenti. Maecenas auctor tristique hendrerit. Aenean vestibulum dolor ut lorem hendrerit in tempus orci sagittis. Nullam pretium suscipit malesuada. Pellentesque in sodales ante. Integer a pulvinar est. Nullam sodales, tellus scelerisque eleifend tincidunt, lectus massa fringilla enim, non sodales mauris enim vel lectus. Nulla facilisi. Nam semper mollis vulputate. Curabitur et dolor mauris, quis aliquam ipsum. Quisque a sem diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Nullam semper, magna sed porttitor posuere, ante orci pulvinar odio, vel pellentesque nibh quam eu risus. - -Maecenas ut erat et tortor luctus iaculis id congue orci. Nulla condimentum enim eleifend nibh ornare tincidunt. Morbi euismod erat in enim vulputate sagittis. Sed luctus sagittis commodo. Maecenas hendrerit orci quis mauris ornare venenatis. Pellentesque congue augue non massa pharetra tempus. In hac habitasse platea dictumst. Sed porta molestie orci vel semper. Pellentesque sed congue est. Mauris sed orci vel leo feugiat faucibus et sed nisl. Nullam purus elit, aliquam sed tempor sit amet, lacinia tincidunt massa. Cras orci libero, lobortis sed gravida quis, tristique ac ligula. Curabitur suscipit malesuada justo ut elementum. - -Fusce eget nibh at urna suscipit mollis sed ut purus. Curabitur et augue est. Maecenas vulputate vestibulum mi vitae aliquet. Morbi egestas pulvinar nibh, quis gravida quam hendrerit eu. Integer quis condimentum neque. Donec ultricies sodales dui vitae porta. Suspendisse lobortis elit id sapien accumsan quis posuere libero mollis. Quisque interdum neque vitae tellus pulvinar dignissim. Nam consectetur orci non leo pretium ut viverra nisl sodales. Etiam eu pellentesque enim. Etiam in massa augue. Nunc quis arcu orci, eget feugiat purus. Suspendisse nec lorem lacus, vitae commodo lorem. Nulla vulputate mi et eros venenatis tincidunt. In mollis neque sit amet leo facilisis convallis vestibulum nibh aliquam. Cras sagittis dui sed dolor facilisis cursus. Maecenas condimentum vestibulum condimentum. Suspendisse molestie tempus arcu eget aliquet. Fusce quis quam at orci faucibus imperdiet. - - -</div> -<div class="panel" id="projects"> - -h2. Projects - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut diam orci, consequat a varius sed, malesuada in leo. Donec non urna a risus bibendum aliquam. Ut luctus, diam sed faucibus iaculis, diam diam bibendum massa, non adipiscing ligula diam facilisis tortor. Suspendisse potenti. Maecenas auctor tristique hendrerit. Aenean vestibulum dolor ut lorem hendrerit in tempus orci sagittis. Nullam pretium suscipit malesuada. Pellentesque in sodales ante. Integer a pulvinar est. Nullam sodales, tellus scelerisque eleifend tincidunt, lectus massa fringilla enim, non sodales mauris enim vel lectus. Nulla facilisi. Nam semper mollis vulputate. Curabitur et dolor mauris, quis aliquam ipsum. Quisque a sem diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Nullam semper, magna sed porttitor posuere, ante orci pulvinar odio, vel pellentesque nibh quam eu risus. - -Maecenas ut erat et tortor luctus iaculis id congue orci. Nulla condimentum enim eleifend nibh ornare tincidunt. Morbi euismod erat in enim vulputate sagittis. Sed luctus sagittis commodo. Maecenas hendrerit orci quis mauris ornare venenatis. Pellentesque congue augue non massa pharetra tempus. In hac habitasse platea dictumst. Sed porta molestie orci vel semper. Pellentesque sed congue est. Mauris sed orci vel leo feugiat faucibus et sed nisl. Nullam purus elit, aliquam sed tempor sit amet, lacinia tincidunt massa. Cras orci libero, lobortis sed gravida quis, tristique ac ligula. Curabitur suscipit malesuada justo ut elementum. - -Fusce eget nibh at urna suscipit mollis sed ut purus. Curabitur et augue est. Maecenas vulputate vestibulum mi vitae aliquet. Morbi egestas pulvinar nibh, quis gravida quam hendrerit eu. Integer quis condimentum neque. Donec ultricies sodales dui vitae porta. Suspendisse lobortis elit id sapien accumsan quis posuere libero mollis. Quisque interdum neque vitae tellus pulvinar dignissim. Nam consectetur orci non leo pretium ut viverra nisl sodales. Etiam eu pellentesque enim. Etiam in massa augue. Nunc quis arcu orci, eget feugiat purus. Suspendisse nec lorem lacus, vitae commodo lorem. Nulla vulputate mi et eros venenatis tincidunt. In mollis neque sit amet leo facilisis convallis vestibulum nibh aliquam. Cras sagittis dui sed dolor facilisis cursus. Maecenas condimentum vestibulum condimentum. Suspendisse molestie tempus arcu eget aliquet. Fusce quis quam at orci faucibus imperdiet. - - -</div> -<div class="panel" id="about"> - -h2. About - -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut diam orci, consequat a varius sed, malesuada in leo. Donec non urna a risus bibendum aliquam. Ut luctus, diam sed faucibus iaculis, diam diam bibendum massa, non adipiscing ligula diam facilisis tortor. Suspendisse potenti. Maecenas auctor tristique hendrerit. Aenean vestibulum dolor ut lorem hendrerit in tempus orci sagittis. Nullam pretium suscipit malesuada. Pellentesque in sodales ante. Integer a pulvinar est. Nullam sodales, tellus scelerisque eleifend tincidunt, lectus massa fringilla enim, non sodales mauris enim vel lectus. Nulla facilisi. Nam semper mollis vulputate. Curabitur et dolor mauris, quis aliquam ipsum. Quisque a sem diam. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla facilisi. Nullam semper, magna sed porttitor posuere, ante orci pulvinar odio, vel pellentesque nibh quam eu risus. - -Maecenas ut erat et tortor luctus iaculis id congue orci. Nulla condimentum enim eleifend nibh ornare tincidunt. Morbi euismod erat in enim vulputate sagittis. Sed luctus sagittis commodo. Maecenas hendrerit orci quis mauris ornare venenatis. Pellentesque congue augue non massa pharetra tempus. In hac habitasse platea dictumst. Sed porta molestie orci vel semper. Pellentesque sed congue est. Mauris sed orci vel leo feugiat faucibus et sed nisl. Nullam purus elit, aliquam sed tempor sit amet, lacinia tincidunt massa. Cras orci libero, lobortis sed gravida quis, tristique ac ligula. Curabitur suscipit malesuada justo ut elementum. - -Fusce eget nibh at urna suscipit mollis sed ut purus. Curabitur et augue est. Maecenas vulputate vestibulum mi vitae aliquet. Morbi egestas pulvinar nibh, quis gravida quam hendrerit eu. Integer quis condimentum neque. Donec ultricies sodales dui vitae porta. Suspendisse lobortis elit id sapien accumsan quis posuere libero mollis. Quisque interdum neque vitae tellus pulvinar dignissim. Nam consectetur orci non leo pretium ut viverra nisl sodales. Etiam eu pellentesque enim. Etiam in massa augue. Nunc quis arcu orci, eget feugiat purus. Suspendisse nec lorem lacus, vitae commodo lorem. Nulla vulputate mi et eros venenatis tincidunt. In mollis neque sit amet leo facilisis convallis vestibulum nibh aliquam. Cras sagittis dui sed dolor facilisis cursus. Maecenas condimentum vestibulum condimentum. Suspendisse molestie tempus arcu eget aliquet. Fusce quis quam at orci faucibus imperdiet. - - -</div>
M content/rawline.textilecontent/rawline.textile

@@ -1,10 +1,13 @@

----- permalink: rawline +filters_pre: +- erb +- redcloth title: RawLine +date: 2009-02-28 14:02:13 +01:00 tags: [] type: page -filter_pre: textile ----- h2. RawLine

@@ -19,28 +22,28 @@ h3. Installation

The simplest method to install RawLine is to install the gem: -<typo:code>gem install rawline</typo:code> +<typo:code>gem install rawline<% end %> h3. Usage Editor initialization: -<typo:code lang="ruby"> +<% highlight :ruby do %> require 'rawline' editor = RawLine::Editor.new -</typo:code> +<% end %> Key binding: -<typo:code lang="ruby"> +<% highlight :ruby do %> editor.bind(:ctrl_z) { editor.undo } editor.bind(:up_arrow) { editor.history_back } editor.bind(:ctrl_x) { puts "Exiting..."; exit } -</typo:code> +<% end %> Setup word completion -<typo:code lang="ruby"> +<% highlight :ruby do %> editor.completion_proc = lambda do |word| if word ['select', 'update', 'delete', 'debug', 'destroy'].find_all { |e| e.match(/^#{Regexp.escape(word)}/) }

@@ -48,30 +51,30 @@ end

end editor.completion_append_string = " " -</typo:code> +<% end %> Read input: -<typo:code lang="ruby">editor.read("=> ", true)</typo:code> +<% highlight :ruby do %>editor.read("=> ", true)<% end %> h3. Replacing Readline Simply include the RawLine (or Rawline) module: -<typo:code lang="ruby">include Rawline</typo:code> +<% highlight :ruby do %>include Rawline<% end %> …and you’ll get: -<typo:code lang="ruby"> +<% highlight :ruby do %> readline(prompt, add_history) # RawLine::Editor#read(prompt, add_history) HISTORY # RawLine::Editor#history FILENAME_COMPLETION_PROC # Rawline::Editor#filename_completion_proc # ... -</typo:code> +<% end %> but also: -<typo:code lang="ruby">Rawline.editor # RawLine::Editor</typo:code> +<% highlight :ruby do %>Rawline.editor # RawLine::Editor<% end %> …which opens a world of endless possibilities! ;-)
M content/wedding.textilecontent/wedding.textile

@@ -1,10 +1,12 @@

----- permalink: wedding +filters_pre: +- redcloth title: Wedding +date: 2009-06-06 05:53:12 +02:00 tags: [] type: page -filter_pre: textile ----- h2. Roxanne & Fabio's Wedding
A files/css/code.css

@@ -0,0 +1,60 @@

+.highlight {overflow: auto;} +.highlight .hll { background-color: #ffffcc } +.highlight .c { color: #228B22 } /* Comment */ +.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ +.highlight .k { color: #8B008B; font-weight: bold } /* Keyword */ +.highlight .cm { color: #228B22 } /* Comment.Multiline */ +.highlight .cp { color: #1e889b } /* Comment.Preproc */ +.highlight .c1 { color: #228B22 } /* Comment.Single */ +.highlight .cs { color: #8B008B; font-weight: bold } /* Comment.Special */ +.highlight .gd { color: #aa0000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #aa0000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00aa00 } /* Generic.Inserted */ +.highlight .go { color: #888888 } /* Generic.Output */ +.highlight .gp { color: #555555 } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #aa0000 } /* Generic.Traceback */ +.highlight .kc { color: #8B008B; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #8B008B; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #8B008B; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #8B008B; font-weight: bold } /* Keyword.Pseudo */ +.highlight .kr { color: #8B008B; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #a7a7a7; font-weight: bold } /* Keyword.Type */ +.highlight .m { color: #B452CD } /* Literal.Number */ +.highlight .s { color: #CD5555 } /* Literal.String */ +.highlight .na { color: #658b00 } /* Name.Attribute */ +.highlight .nb { color: #658b00 } /* Name.Builtin */ +.highlight .nc { color: #008b45; font-weight: bold } /* Name.Class */ +.highlight .no { color: #00688B } /* Name.Constant */ +.highlight .nd { color: #707a7c } /* Name.Decorator */ +.highlight .ne { color: #008b45; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #008b45 } /* Name.Function */ +.highlight .nn { color: #008b45; text-decoration: underline } /* Name.Namespace */ +.highlight .nt { color: #8B008B; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #00688B } /* Name.Variable */ +.highlight .ow { color: #8B008B } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mf { color: #B452CD } /* Literal.Number.Float */ +.highlight .mh { color: #B452CD } /* Literal.Number.Hex */ +.highlight .mi { color: #B452CD } /* Literal.Number.Integer */ +.highlight .mo { color: #B452CD } /* Literal.Number.Oct */ +.highlight .sb { color: #CD5555 } /* Literal.String.Backtick */ +.highlight .sc { color: #CD5555 } /* Literal.String.Char */ +.highlight .sd { color: #CD5555 } /* Literal.String.Doc */ +.highlight .s2 { color: #CD5555 } /* Literal.String.Double */ +.highlight .se { color: #CD5555 } /* Literal.String.Escape */ +.highlight .sh { color: #1c7e71; font-style: italic } /* Literal.String.Heredoc */ +.highlight .si { color: #CD5555 } /* Literal.String.Interpol */ +.highlight .sx { color: #cb6c20 } /* Literal.String.Other */ +.highlight .sr { color: #1c7e71 } /* Literal.String.Regex */ +.highlight .s1 { color: #CD5555 } /* Literal.String.Single */ +.highlight .ss { color: #CD5555 } /* Literal.String.Symbol */ +.highlight .bp { color: #658b00 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #00688B } /* Name.Variable.Class */ +.highlight .vg { color: #00688B } /* Name.Variable.Global */ +.highlight .vi { color: #00688B } /* Name.Variable.Instance */ +.highlight .il { color: #B452CD } /* Literal.Number.Integer.Long */ +
M files/js/feeds.jsfiles/js/feeds.js

@@ -48,7 +48,7 @@ };

function backtype_comments() { - $.getJSON("/js/comments.json", + $.getJSON("/extras/comments.json", function(data){ var comment_list = $("<ul></ul>"); $.each(data.comments, function(i, comment){
M files/js/slider.jsfiles/js/slider.js

@@ -1,7 +1,7 @@

// Thanks http://jqueryfordesigners.com/coda-slider-effect/ (function(){ $.slider = function(){ - var $panels = $('#slider .scrollContainer > div'); + var $panels = $('#slider .scrollContainer > div.panel'); var $container = $('#slider .scrollContainer'); // if false, we'll float all the panels left and fix the width
M layouts/default.htmlayouts/default.htm

@@ -21,11 +21,12 @@ <link rel="shortcut icon" href="http://www.h3rald.com/favicon.ico" type="image/x-icon" />

<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta content="44.388041;9.073248" name="ICBM" /> - <script src="http://www.google.com/jsapi?key=ABQIAAAA6h3j8Jri5D_da53UPbEbThRlq2n1sm52B5HDRR5tm6o8XM18FhTKn3v155RpPeD0kWnWG81QEhhifQ" type="text/javascript"></script> - <script src="/js/search.js" type="text/javascript"></script> <link href="/css/layout.css" media="all" rel="stylesheet" type="text/css" /> <link href="/css/text.css" media="all" rel="stylesheet" type="text/css" /> <link href="/css/elements.css" media="all" rel="stylesheet" type="text/css" /> + <link href="/css/code.css" media="all" rel="stylesheet" type="text/css" /> + <script src="http://www.google.com/jsapi?key=ABQIAAAA6h3j8Jri5D_da53UPbEbThRlq2n1sm52B5HDRR5tm6o8XM18FhTKn3v155RpPeD0kWnWG81QEhhifQ" type="text/javascript"></script> + <script src="/js/search.js" type="text/javascript"></script> <script src="/js/cufon-yui.js" type="text/javascript"></script> <script src="/js/Chopin_400.font.js" type="text/javascript"></script> <script src="/js/Cardo_400.font.js" type="text/javascript"></script>
A lib/albino.rb

@@ -0,0 +1,86 @@

+## +# Wrapper for the Pygments command line tool, pygmentize. +# +# Pygments: http://pygments.org/ +# +# Assumes pygmentize is in the path. If not, set its location +# with Albino.bin = '/path/to/pygmentize' +# +# Use like so: +# +# @syntaxer = Albino.new('/some/file.rb', :ruby) +# puts @syntaxer.colorize +# +# This'll print out an HTMLized, Ruby-highlighted version +# of '/some/file.rb'. +# +# To use another formatter, pass it as the third argument: +# +# @syntaxer = Albino.new('/some/file.rb', :ruby, :bbcode) +# puts @syntaxer.colorize +# +# You can also use the #colorize class method: +# +# puts Albino.colorize('/some/file.rb', :ruby) +# +# Another also: you get a #to_s, for somewhat nicer use in Rails views. +# +# ... helper file ... +# def highlight(text) +# Albino.new(text, :ruby) +# end +# +# ... view file ... +# <%= highlight text %> +# +# The default lexer is 'text'. You need to specify a lexer yourself; +# because we are using STDIN there is no auto-detect. +# +# To see all lexers and formatters available, run `pygmentize -L`. +# +# Chris Wanstrath // chris@ozmm.org +# GitHub // http://github.com +# +require 'rubygems' +require 'open4' + +class Albino + @@bin = 'pygmentize' + + def self.bin=(path) + @@bin = path + end + + def self.colorize(*args) + new(*args).colorize + end + + def initialize(target, lexer = :text, format = :html) + @target = File.exists?(target) ? File.read(target) : target rescue target + @options = { :l => lexer, :f => format, :O => 'encoding=utf-8' } + end + + def execute(command) + output = '' + Open4.popen4(command) do |pid, stdin, stdout, stderr| + stdin.puts @target + stdin.close + output = stdout.read.strip + [stdout, stderr].each { |io| io.close } + end + output + end + + def colorize(options = {}) + html = execute(@@bin + convert_options(options)) + # Work around an RDiscount bug: http://gist.github.com/97682 + html.to_s.sub(%r{</pre></div>\Z}, "</pre>\n</div>") + end + alias_method :to_s, :colorize + + def convert_options(options = {}) + @options.merge(options).inject('') do |string, (flag, value)| + string + " -#{flag} #{value}" + end + end +end
A lib/bbcode_filter.rb

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

+require 'rubygems' +require 'bb-ruby' + +class BbcodeFilter < Nanoc::Filter + identifier :bbcode + + def run(content) + content.bbcode_to_html + end + +end
D lib/default.rb

@@ -1,2 +0,0 @@

-# All files in the 'lib' directory will be loaded -# before nanoc starts compiling.
A lib/highlighter.rb

@@ -0,0 +1,19 @@

+ +# Monkey patch Nanoc::Helpers::Filtering + +module Nanoc::Helpers::Filtering + + def highlight(syntax, &block) + # Seamlessly ripped off from the filter method... + # Capture block + data = capture(&block) + # Filter captured data + filtered_data = "<notextile>"+Albino.colorize(data, syntax)+"</notextile>" rescue data + # Append filtered data to buffer + buffer = eval('_erbout', block.binding) + buffer << filtered_data + end + +end + +include Nanoc::Helpers::Filtering
M tasks/db.raketasks/db.rake

@@ -6,6 +6,46 @@ require 'mysql'

require 'sequel' require 'yaml' +module TypoUtils + + def get_filter(db, fid) + filter = db[:text_filters].where("id = ?", fid).get(:name).downcase + # Multiple filters are not handled (e.g. markdown smartypants) + filter = filter.split(' ')[0] + # Prepare metadata + case filter + when 'textile' then + return ['redcloth'], 'textile' + when 'markdown' then + return ['bluecloth'], 'markdown' + when 'bbcode' then + return ['bbcode'], 'bbcode' + else + return [], 'txt' + end + end + + def convert_code_blocks(text) + text.gsub!(/<typo:code lang="([a-zA-Z0-9]+)">/, '<% highlight :\1 do %>') + text.gsub!(/<\/typo:code>/, "<% end %>") + text + end + + def write_page(meta, contents, extension) + path = (meta['type'] == 'article') ? Pathname.new(Dir.pwd)/"content/articles/" : Pathname.new(Dir.pwd)/"content/" + name = "#{meta['permalink']}.#{extension}" + path.mkpath + (path/name).open('w+') do |f| + f.print "--" + f.puts meta.to_yaml + f.puts "-----" + f.puts contents + end + end + +end + +include TypoUtils namespace :db do

@@ -14,26 +54,26 @@ end

task :migrate_contents, :db, :usr, :pwd do |t, args| raise RuntimeError, "Please provide :db, :usr, :pass" unless args[:db] && args[:usr] && args[:pwd] - write_article = lambda do |meta, contents| - path = (meta['type'] == 'article') ? Pathname.new(Dir.pwd)/"content/articles/" : Pathname.new(Dir.pwd)/"content/" - name = "#{meta['permalink']}.#{meta['filter_pre']}" - path.mkpath - (path/name).open('w+') do |f| - f.print "--" - f.puts meta.to_yaml - f.puts "-----" - f.puts contents - end - end db = Sequel.mysql args[:db], :user => args[:usr], :password => args[:pwd], :host => 'localhost' + # Remove all existing pages! + dir = Pathname.new(Dir.pwd/'content') + dir.rmtree if dir.exist? + dir.mkpath + # Prepare page data db[:contents].where("state = 'published' || type = 'Page'").each do |a| meta = {} meta['tags'] = (a[:keywords]) ? a[:keywords].downcase.split(", ") : [] - meta['filter_pre'] = db[:text_filters].where("id = ?", a[:text_filter_id]).get(:name).downcase meta['permalink'] = a[:permalink] || a[:name] meta['title'] = a[:title] meta['type'] = a[:type].downcase - write_article.call meta, a[:body]+a[:extended].to_s + meta['date'] = a[:published_at] + meta['filters_pre'], extension = get_filter db, a[:text_filter_id] + contents = a[:body]+a[:extended].to_s + if contents.match /<typo:code/ then + contents = convert_code_blocks contents + meta['filters_pre'] = ['erb'].concat meta['filters_pre'] + end + write_page meta, contents, extension end end