Blog

iPhone-ized

I updated this morning the site to have media queries that actually work on the iPhone.

I'll still need to check other non-retina iPhones and android phones (ugh).



CakePHP Migrations 2.1, migration guide

I'm in the process of moving a CakePHP 1.3 app into the 2.1 world.

One thing that changed that I could not find documented anywhere is that the new migration plugin doesn't use the map.php file anymore but relies on a naming convention.

VersionNumber-name.php

Where VersionNumber is the version number of the migration. For example on my app:

001_initial.php
002_chapter_word_count.php
003_story_disclaimer_field.php
004_follows.php
005_reviews.php
006_chapter_review_count.php

You can pad with as many zeros as you feel you'll need. Are 999 migrations not enough? Also each class name needs to be changed to the camelized version of the file name without the version number, so 001_initial.php should start like this:

<?php
    class Initial extends CakeMigration {

And that way CakeDC's migration plugin will detect the migrations again.



Phantomjs: headless webkit

PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, SVG.

PhantomJS is an optimal solution for fast headless testing, site scraping, pages capture, network monitoring and many other use cases.

Very useful.



Retracting Mr. Daisey and the Apple Factory

This American Life is a great podcast, the stories they air are greatly produced and they go to great lengths to research them.

The episode "Mr. Daisey and the Apple Factory", aired on January, started a big backlash against Apple's manufacturing operations and the fact they turn a blind eye to the terrible conditions the manufacturing workers are subjected to.

Today they are retracting that story.

[a Marketplace] China correspondent for the public radio show Marketplace tracked down the interpreter that Daisey hired when he visited Shenzhen China. The interpreter disputed much of what Daisey has been saying on stage and on our show. On this week's episode of This American Life, we will devote the entire hour to detailing the errors in "Mr. Daisey Goes to the Apple Factory."

The backlash this story generated did change the attitude of Apple, now they have become members of the Fair Labor Association and have become even more vocal about their standards of social responsibility across our worldwide supply chain.

Mike Daisey was wrong of abusing the loudspeaker that This American Life is, but I think he doesn't really regret it, from his blog:

What I do is not journalism. The tools of the theater are not the same as the tools of journalism. For this reason, I regret that I allowed THIS AMERICAN LIFE to air an excerpt from my monologue. THIS AMERICAN LIFE is essentially a journalistic ­- not a theatrical ­- enterprise, and as such it operates under a different set of rules and expectations. But this is my only regret. I am proud that my work seems to have sparked a growing storm of attention and concern over the often appalling conditions under which many of the high-tech products we love so much are assembled in China.

It's going to be interesting to listen to next week's TAL and find out what "creative licenses" Daisey took and what is the truth.

I agree with Daisey's take that his stunt shaked the status quo. That is good. Lying to TAL and Ira Glass. Not cool.

 

Binding A Backbone View To A Model

I'm learning Backbone.js and this article has helped me to get a first grasp on how to manage the separation of Views and model and how to wire them up to update each other as necessary: changes in the view will update the model which triggers the validation of the fields which in turns has to update the view.

It's very refreshing to finally have MVC on the client side, no more crazy jQuery wires all over.

 

Start the shredders

I've said it before, people need to stop working on updating their résumé and start working on publicly visible side-projects.

Now, this article shows a new trend where employers are not looking at résumés but want to know you better by your online interactions.

Companies are increasingly relying on social networks such as LinkedIn, video profiles and online quizzes to gauge candidates' suitability for a job. While most still request a résumé as part of the application package, some are bypassing the staid requirement altogether.



Pipe Dream?

Marco proposes:

it would be more productive to significantly reduce or eliminate our support of the MPAA member companies starting today

Here's the list of studios you have to stop buying from:

it’s easy to see who the MPAA represents: Disney, Sony Pictures, Paramount, 20th Century Fox, Universal, and Warner Brothers. (Essentially, all of the major movie studios.)

Basically you have to stop watching things like (a quick selection from IMDb):

  • The Simpson's
  • Bones
  • Lilo & Stitch
  • Star Wars
  • TRON
  • A Clockwork Orange

This is depressing. Even Amélie was touched by 20th Century Fox for distribution purposes.

I agree with him, but it's near impossible to stop supporting "Essentially, all of the major movie studios".



Talking about having personal files on Megaupload

This article complements the two comments I made on my previous post.

I said:

With Megaupload closed, should you backup your online backups?

Answer:

In short, if you stored important files on Megaupload, I really hope you had an up-to-date backup on your computer.

And then I said:

Also: will this takedown have an effect on the users? Are we gonna see the RIAA or MPAA sifting through the logs and suing en masse?

This what the article hast to offer:

It’s almost guaranteed that Megaupload stored the IP address of file uploaders, and the Feds could pursue individual copyright infringement cases at a later date.

Choose your acronym: RIAA, MPAA, FBI.



Feds, Please Return My Personal Files Stored at MegaUpload!

However, do the feds realize that hundreds of thousands, perhaps millions of people used the site to share research data, work documents, personal video collections and much more?

With Megaupload closed, should you backup your online backups?

Also: will this takedown have an effect on the users? Are we gonna see the RIAA or MPAA sifting through the logs and suing en masse?



Learn How to Write iOS Apps

Ash Furrow lists a great list of resources for learning iOS development.

He mentions that books didn't work for him although didn't list the books he tried.

To get started, some people buy a book or find some good online tutorials. I tried both approaches, and the online tutorials were definitely better.

I'm going through Nerd Ranch's "iOS Programming: The Big Nerd Ranch Guide" recommended to me by Marco Arment and it has been very good because it makes you do the example apps.

4+1 problems with the new Calgary CITYonline (online store)

I've been buying my Calgary public transit passes via the online store and recently they launched a new version called CITYonline. It looks ok, and it's definitely a step up from the previous version. But in the 10 minutes that took me to register and buy next month's pass I found some glaring usability and security problems.

First: you broke my browser

Disabling copy and paste is the new "right click is disabled" (so, 1997).

Dear Calgary: people use copy and paste, they like it and rely on it. When the iPhone didn't have copy and paste people complained.

So, why do you disable it?

If you are worried that your database will get filled with incorrect emails because of typos then check the SMTP response headers. Or just accept errors as a part of life, but don't make your lives easier by dumping shit on your users.

Second: so many options

On any listing of products, Calgary chose to use a select input element (marked with the red arrows).

Select elements (combo boxes in corporate parlance) are meant to give the users more than one option to choose from.

Each of those select elements have only one option. There's nothing to choose!

This is a small problem and can be solved easily, but still shows that the people who made the site didn't know what they were doing.

Third: I say "Yes", but I may mean "No"

When you create your account and confirm your email (more on that on the next problem) you are required to select a password, and a helpful message tells you that you have to use at least 7 characters.

Then, I tried to use 44 using 1Password and noticed that it looked shorter than 44 characters.

We'll it turns out they tell you to use at least 7 characters, but don't tell you that you have a maximum of 20 available.

That's a very bad usability problem, it's like saying to your kid "yeah, go out and party all night and come whenever" and "forgetting" to tell them that you won't open the door when they arrive at 3 in the morning =).

BTW: they do the same thing with emails, limiting them to 50 characters. The maximum length of an email address is actually 254 characters.

Fourth: here are the keys to my kingdom

Registering is a two step process in CITYonline:

  1. You write your name and email (no copy/pasting!)
  2. You receive a temporary password to your email.

When you go and login with said temporary password, it forces you to set a new password. Very safe.

And then they send you FRIGGIN' PASSWORD TO YOUR EMAIL!!!!

Never, ever send a password to the user's email EVER!

  1. Email is not a secure enclosure.
  2. It potentially means that the City of calgary is storing the passwords in a readable way.

Good thing CITYonline doesn't store your credit card information (or does it?).

Fouth plus one: the emails suck

This one is just a pet peeve.

The email I received from CITYonline has header image of 1029 pixels wide, this wreaks havoc with many email clients as you are forced to scroll back and forth to read the whole thing.

Just use an email template from the pro's.



Never send a password in an email

Emails are not safe:

  • They are sent via the network in plain text so any attacker snooping the net could grab it.
  • They are stored in plain text, if somebody gains access to my computer they could be read, same if someone breaks into my email account.

Double whammy if you send the login on the same email.

The linked pdf has a lot more information and solutions, if you're implementing password recovery in your site read it.



Should you freelance while having a full time job?

An interesting interview that really resonates with me and my current situation. Specially I liked Ben's replies on how to overcome procrastination and self-depreciation of your abilities.

I realized most great designers are actually busy finding clients, speaking at events, and doing the “office work” of running a small business, and raising families – they are just as strapped for time as I am, if not more so.

One of the biggest problems he experienced:

I’ve always struggled with a sense of urgency…

But you still got stuff done. So, explain your motivation process. Parkinson’s Law says work expands to fill the time available to complete it. So when I set long deadlines to avoid missing them, I also give myself a lot of time to procrastinate and have no urgency. It goes back to mini deadlines.

Read the whole interview, it's worth your time.

Grandpa

When I was a kid I had a favorite grandpa.

He often came to visit and brought small toys and trinkets for us to play.

Once, he arrived while I was still asleep and brought a pizza shaped pencil sharpener. My brother made me think it was real pizza and I tried to bite it.

Another time he started calling me names, a mix of my name and the name of a very quirky Mexican singer. I got so mad that I did the same, called him a similar name. He laughed so hard and for so long that I got even more pissed off.

Every time we met after that, the story would come up.

He once put a plastic Tupperware on a real oven.

He liked to go fishing and taught me to love fishing. He once sent me to a steep river bank to recover an abandoned can of live bait.

He waited until I was down there to tell me not to fall in the piranha infested waters.

He taught me how to play dominoes like a master: keep your mouth shut, keep count of who has what and don't grab more than the 7 pieces you need after each shuffle.

He told me about this girl that kept taking all of the pieces and making the other players wait. To teach her a lesson he threw her a piece to her forehead, got up and left the table.

Tough love I guess.

So many stories...

And then he got prostate cancer

I asked my dad recently and he told me he tried to have him get checked but he wouldn't budge.

I sure hope my dad had thrown a domino piece to his forehead to make him understand, but it probably wouldn't have worked because he was too stubborn.

He was always strong and seeing him on his deathbed, no larger than a 5 year old is one of the worse images I've ever experienced. It left me scared of cancer for the longest.

So before November ends, go ahead and donate a little bit to Movember:

During November each year, Movember is responsible for the sprouting of moustaches on thousands of men’s faces, in Canada and around the world. With their "Mo's", these men raise vital funds and awareness for men's health, specifically prostate cancer.

You can support this campaign by donating through me.

Although it says " You are making a donation to Joaquin Windmuller" no money will be ending in my pocket, it's just a way to track participation.

If you don't want to donate to me

Go ahead and do a general donation.

Even if you don't donate

Go get checked, prostate cancer has a 90% or more chance of cure if caught early, but it has very little symptoms until it has grown too much and is probably too late. According to the Prostate Cancer Canada Network:

Without regular testing (PSA & DRE), it is very difficult to find early stage prostate cancer.

And if you don't have a prostate (a.k.a. you're a girl) make your boys get tested.

 

Git failed to push some refs – the multiple branch variant

I was having this problem a couple of minutes ago. A couple of interesting comments already there:

your push works, you just get a confusing error about the other branches that git tries to auto-push.

So basically, the push on you branch does work. I checked on github immediatly and it didn't show, but it could have been just a matter on timing.

And this comment:

For whatever reason, by default git push pushes to all branches on the remote. To set this to the default that you’re expecting (and that really seems the only sane and reasonable default to me, but I digress), you can use git config remote.origin.push HEAD. But meanwhile, since you may wind up using git from other machines and forget that the default behavior is broken, you should probably always just specify the remote and branch explicitly.

So, using your example here, you would use:

git push origin fetch-flow

The problem with this is that if you mistype your branch, you could wind up creating a new branch on the remote with the typo, e.g. something like fletch-flow. So that brings us to what is likely the best git push habit to get into:

git push origin HEAD

This will push only the current branch to a branch of the same name on the remote.