Wednesday, December 29, 2010

Bring the future to the web! (Win A Book Apart)

I have recently ordered (with a friend) a couple of copies of the recently released CSS3 FOR WEB DESIGNERS from the very fine «A Book Apart» which is, so to speak, the editorial wing of one of my favourite web tech and philosophy webs: A List Apart (If you aren’t already suscribed to it you should!).
There was a mistake with the delivery, and we received a copy of HTML5 FOR WEB DESIGNERS instead of the second CSS3 we had asled for.
We took pics of the just opened packaging and emailed A Book Apart support who were super fast and so kind so send us the missing book via express mail an let us keep the missshiped (is that even a word?) item.
So we feel compelled to make sure it gets to the right hands and be grateful at the same time so we have decided to give it away in an appropiately geeky way.

From now on, until Thu Jan 06 00:00:00 +0100 2011 any tweet including the text will be eligible to win the Book.

  • You must be following @oinak as to be contacted by DM to agree shiping details.
  • You must live in Spain (wherein I will pay the postage) or pay for the extra mailing yourself.
  • Tweet must say something nice about HTML5, A Book Apart, A List Apart or about @oinak ;-)
  • If winner fails to comply with any of the requirements I will choose another, same method.

Easy peasy, ladies and gentlemen: ready, steady, GO!

Friday, December 10, 2010

Trying Chrome Web Store

Two days ago Google released their Chrome app store which is intended to provide a common source of apps for both the Chrome browser and the newChromeOS powered devices
And I wondered how easy or uneasy it would be to put up an app for the Chrome ecosystem, and the anwser is: Do you have a web service? you are done.
Yes? yes
Yesterday, a friend of mine said Chrome apps are nothing but bookmarks. but there is a bit more, there is a thin layer of candy consisting on: discovery, ratings, feedback, simplified payment gateway, plattform shared customer trust…
The process is quite straightforward if you go to and follow the instructions there.
All you need is:

  • An icon, best is 96×96 PNG with transparent border until 128×128 pixels.
  • An screenshot proportional to 800×550.
  • A manifest file like:

 1 {
 2   "name": "Oinak",
 3   "description": "Subscribe to «Oinak on the Web»",
 4   "version": "1.0.1",
 5   "icons": { "128": "128.png" },
 6   "app": {
 7     "urls": [ "" ],
 8     "launch": { "web_url": "" }
 9   },
10   "permissions": []
11 }
Then you have to put the PNG icon and the manifest into a folder into a Zip that you upload, upload the screenshot, pay the one time 5 bucks developer fee, and validate (through the webmaster tools) that you own the url the app points to, via a metatag, an uploaded file, a DNS change and a couple other options.
And voilá in a minute you have: A shiny chrome app
If you want to see the whole thing, fork me at

Wednesday, December 1, 2010

Pedal like a hacker

If you feel like or want to become a hacker, in the good sense (someone who makes things work beyond perceived limits in a clever way), here is a free tip for you, here it goes:

Own, ride and repair your own bike
Conor Malibu

Here are some quick reasons
  • It is a simple mechanism to learn and comprehend 
  • All componentes are at plain sight 
  • Every part is replaceable and/or easy to modify or repair 

It is in the spirit of the Craftmanship and helps you tou conceive the workings of a system composed of multiple parts, yet simple enough to keep it in mind and to not become a burden. Do you remember the ‘Know and maintain your own tool’, your programming language/framework does not have anything to do with wheels, brakes, pumps etc. but it DOES have to do with parts interacting, with standards that allow a part to be replaced, with tuning to one’s needs for improving performance and so on.

In case you don’t see my philosophical point…

Here are some not hackerdom related reasons
  • It’s healthier to cycle-commute if you can 
  • and cheaper 
  • and greener
I love cycling to work sign and traffic jam
The sign reads: ‘I love cycling to work’ over Madrid’s every morning traffic jam.
Lame excuses you shouldn’t be making any more and the reasons you shoundn’t 
I will be late to work
I pedal about 20km (12.42 miles) round trip every day to work in a sloppy city like Madrid and I still win my car-driving friend on a similar distance by some minutes. 
I will stink
Slower pace, deodorant, soap, a towel and extra clothes, modern miracles that fit in a back pack 
I don’t know how to repair a bike
Come on! 
I am afraid of the traffic
Then ride in a safe way 
My work place is too far away
Combine a foldable bike with public transport 
My work is too close/I telecommute
Pedal during part of the two hours you aren’t driving to work ;-)

Wednesday, November 24, 2010

Bash and source control (updated)

Just a quick note for myself and for those of you who do coding and use bash: Do you you want to have a pretty and infromative prompt like:

fer@pilgrim ~/src/ (git:master → 212069f) $

or like
fer@pilgrim ~/src/ (svn:/trunk → 4480) $

Look for the place where your ~/.bashrc file establishes the value of the PS1 special environment variable, comment it out and put this in its place:
 1   #parse_git_branch () {
 2   #  echo -n "$(git name-rev HEAD 2> /dev/null | sed 's#HEAD\ \(.*\)# (git:\1#') → $(git log -1 --pretty=format:%h))"
 3   #}
 5   # more elegant solution edited to include @mrdias suggestion
 6   parse_git_branch () {
 7     echo -n "$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (git:\1/') → $(git log -1 --pretty=format:%h))"
 8   }
 9   parse_svn_branch() {
10     local s=
11     s=" ($(parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | awk '{print "svn:"$1"" }') → $(parse_svn_revision))"
12     echo -n "$s"
13   }
14   parse_svn_url() {
15     svn info 2>/dev/null | sed -ne 's#^URL: ##p'
16   }
17   parse_svn_repository_root() {
18     svn info 2>/dev/null | sed -ne 's#^Root of the repository: ##p'
19   }
20   parse_svn_revision() {
21     svn info | sed -n -e '/^Revision: \([0-9]*\).*$/s//\1/p'
22   }
24   scm_ps1() {
25     if [[ -d ".svn" ]] ; then
26         echo "$(parse_svn_branch)"
27     elif [[ -d ".git" ]] ; then
28         echo "$(parse_git_branch)"
29     fi
30   }
32   RED="\[\033[0;31m\]"
33   RED_BOLD="\[\033[01;31m\]"
34   GREEN="\[\033[0;32m\]"
35   GREEN_BOLD="\[\033[01;32m\]"
36   YELLOW="\[\033[0;33m\]"
37   YELLOW_BOLD="\[\033[01;33m\]"
38   BLUE="\[\033[0;34m\]"
39   BLUE_BOLD="\[\033[01;34m\]"
40   BLACK="\[\033[0;38m\]"
42   export PS1="$YELLOW_BOLD\u$BLACK@$GREEN_BOLD\h $BLUE_BOLD\w$RED\$(scm_ps1)$BLACK$ "

I hope the function names and color constants help you to understand what is going on and allow you to customize it to your own needs and taste.

Good night and happy hacking.

25 Nov 2010 (UPDATE):

I have edited parse_git_branch function as @mdias suggested