Complex Simplicity

What’s not possible has never happend

Ruby triomfeert op RAD Race – news – IT Professional

leave a comment »

Written by Peter Berkenbosch

15 October 2009 at 6:53 pm

Semantic html and Blueprint mixins

leave a comment »

This is the second post about building a website with compass, sass, haml and blueprint.

Lets start with some basic top header navigation, links to the home page, a contact page and an about us page. The links are all in an unordered list. The list is in the top-navigation div. The following haml produces just that:

#top-navigation
  %ul
    %li
      %a{:href=>"/"} Home
    %li
      %a{:href=>"/"} Contact
    %li
      %a{:href=>"/"} About Us

The sass code that styles the basics of this part:

#top-navigation
  +column(24)
  ul
    :list-style none
    :margin 0
    :padding 0
    li
      :float left
      :margin-left 0px
      :margin-right 10px

Noticed the +column(24) ? That is the first blueprint mixin use. It’s a equivalent of using the

<div class="span-24">..</div>

but this time we only use the semantic div id “top-navigation”

Opening the site on http://localhost:4000 shows this:
first top-navigation

Not very fancy yet, but hey we have to start somewhere.

Next I would like to make the links more stylish, so I made the font bigger, change the color, make them capital and add some more space. So I add this to the sass file, right under the :margin-right statement (with the same level of indentation)

li
  ....
  a
    :font-size 1.3em
    :font-weight bold
    :padding 1px 7px
    :text-decoration none
    :text-transform uppercase
    :color = !blue

So, right now the sass is not compiling. Complaining with : Undefined variable: “!blue”. So this is so cool! We can use variables in sass files. So, adding this to our sass file :

!blue = #0597fe

The sass file compile just fine now and the page now looks like this:

top navigation with some style

The color variables can also be placed inside a colors.sass file and then be imported into the screen.sass file with @import colors

More in future articles, please add any remarks, tips or questions in the comments

Written by Peter Berkenbosch

17 July 2009 at 9:56 pm

Getting started with Serve, Compass, Sass, Haml and Blueprint

with one comment

So, this is the first post in a serie about creating a xhtml template with the aid of compass, sass, haml and blueprint.

The tools (gems) of the trade:

Follow the links and install the gems.
Create a compass project with blueprint with the command

compass -f blueprint project-name

I use 2 processes during my development (commands from the project-name directory)

  1. compass -w .
  2. serve

The first process watches the current directory and compiles changes made to the sass files, while the second command starts a WEBrick server on port 4000 to serve the project. (haml, js, css etc).
Open the project in your favorite editor. I use TextMate with the following bundles

I found this article that describes the installation of the TextMate Haml Bundle.

Open the screen.sass file from the src directory and take a look at the generated sass for you. I generaly change it to look like this:

// This import applies a global reset to any page that imports this stylesheet.
@import blueprint/reset.sass
// To configure blueprint, edit the partials/base.sass file.
@import partials/base.sass
// Import all the default blueprint modules so that we can access their mixins.
@import blueprint
// Import the non-default scaffolding module.
@import blueprint/modules/scaffolding.sass

// To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
+blueprint

body
  +blueprint-typography
  +blueprint-utilities
  +blueprint-debug
  +blueprint-interaction
  :font-size 62.5%
  .container
    +container

Add the files _layout.haml and index.haml to the root of the project.
The _layout.haml file is quite similar to a Rails layout file and Serve detects and uses this file as the layout file.

The _layout.haml looks like this (for now):

!!!Strict
%html
  %head
    %link{:rel=>"stylesheet", :href=>"stylesheets/screen.css", :media=>"screen", :type=>"text/css"}
    %link{:rel=>"stylesheet", :href=>"stylesheets/print.css", :media=>"print", :type=>"text/css"}
    <!--[if IE]>
    %link{:rel=>"stylesheet", :href=>"stylesheets/ie.css", :media=>"screen, projection", :type=>"text/css"}
    < ![endif]-->

  %body
    .container
      %h1
        Test 123

    = yield

Next episode will build further on sass and the power of the blueprint mixins.

Written by Peter Berkenbosch

17 July 2009 at 9:29 pm

InfoQ: Coping with Bugs on an Agile/Scrum Project

leave a comment »

Thanks to the Twitterverse, found this article on InfoQ by Mark Levison : Coping with Bugs on an Agile/Scrum Project

Reading it, a number of people give their opinion… I kinda like the solution of Mike Cohn : “Yelling across the team room and describing the bug”

On my projects a bug get’s priority attention when it is blocking the user in using the application. Otherwise it is just another story on the board and it’s up to the ProductOwner to prioritize them.

Gonna be on my question list for the Scrum training this September though.

What’s your opinion?

Written by Peter Berkenbosch

17 July 2009 at 4:59 pm

Northern Flies webshop launched!

with one comment

After a lot of coding, tweaking and hacking we finally launched Northern Flies.

See Northern Flies .

It’s a custom implementation on the greate opensource project Spree

I’ve added alot of extensions, some of them are generic enough to extract them into public extensions. I’ll try extracting those extensions in the next couple of weeks.

Until then… if you’re a flyfisher… go check it out  here .

Written by Peter Berkenbosch

23 January 2009 at 3:28 pm

Posted in ruby, rubyonrails, spree

Using helpers inside a controller [rails] [helpers] [custom]

leave a comment »

Needed to do some number_to_currency action in a controller…(don’t aks why :) ) and found this nice code: (adjusted to the helper I needed)

def help
 Helper.instance
end

class Helper
 include Singleton
 include ActionView::Helpers::NumberHelper
end

via Using helpers inside a controller [rails] [helpers] [custom].

Written by Peter Berkenbosch

13 January 2009 at 9:48 pm

Posted in ruby, rubyonrails

Java Programming Notes

leave a comment »

Found a very nice collection of java programming notes… and with the installation of the “Press this” button this post is born :)

See: http://leepoint.net/notes-java/index.html

Written by Peter Berkenbosch

13 January 2009 at 11:38 am

Q-music het geluid is geraden!

leave a comment »

Zojuist even naar Qmusic luisteren…. en krijg nou..wat… iemand raad het geluid.. meer dan 62000 euro! Het was het uitschuiven van de koker van een mop / dweil … weet je wel om het water uit de dweil te drukken.

Nou…. is dat ook weer voorbij :D

Update: hier het filmpje met het geluid.

Written by Peter Berkenbosch

9 December 2008 at 5:53 pm

From Windows to Mac

leave a comment »

So it is finally happening, I’ve ordered a MacBook pro and will make the transition from windows to a mac. The MacBook will be used for all my daily work. Programming in java and rubyonrails off course. Perhaps I even check out cocoa and the iPhone sdk.

The MacBook should arive in about 2 weeks because I wanted the 7200rpm hd. This is only a option when ordered with apple. So I just have to be patient.

When I have some experience to share I will post it here

Written by Peter Berkenbosch

27 July 2008 at 2:39 pm

WordPress iphone app rocks!

leave a comment »

Just installed the wordpress app for iPhone and iPod touch from the apple appstore. This post is written on my ipod

Written by Peter Berkenbosch

22 July 2008 at 9:50 am