Working with Ruby
Hi, I am Jan. This is my old Ruby blog. I still post about Ruby, but I now do it on idiosyncratic-ruby.com. You should also install Irbtools to improve your IRB.

Get your Microscope for MicroLogger: A small Logger on Top of MicroEvent.rb

Being impressed by MicroEvent.js I played with the thought to use such a library not only in JavaScript, but also in Ruby. The design pattern of this kind of message passing is called observer pattern and there is also a library in Ruby’s standard library and some more on rubygems.org. However, MicroEvent.js just nails it,

…read

The CARB stack: Coffee + Angular + Rails + Bower

AngularJS is a great way to build modern web apps and this affects Rails programmers. The combination of both is an excellent choice: Build your single-page app in Angular and let it communicate via JSON with your Rails-API backend (btw, this is exactly what we did for palava). However, you might ask yourself, what the best way to combine Angular and Rails is. Should you use the JavaScript tools world (grunt, yoeman, etc.) or should you prefer the Ruby tools (thor, sprockets)?

…read

Fixing a little anchor permalinks vs. pagination issue (using javascript and jekyll)

I am using the Jekyll blog generator for some projects (still not sure if I really like it..) and came across the following requirement the other day:

  • The blog should only have an index page, no (visible) sub-posts
  • This index page should use pagination
  • There should be the ability to link to a specific blog post

The problem was: I wanted to use anchor links (https://some.url/#post-identifier), but – because of the pagination – blog posts “change” their index page (e.g. in jekyll, they move from /#example to /page2/#example).

…read