Thursday, November 1, 2012

My Home Office Chair

Yes this is where I sit all day when I'm working/coding (at home). It's actually 2 monobloc (plastic) chairs, it's stacked so I get my desired chair height. Does it hurt to sit on it all day? Yes.

Nope this post is not about me being thrifty and not buying a good chair :P Desk chairs used to be my pet peeve when I was still working on an actual office (ie. not remote). I've worked with different companies that provided worst chairs (they shall not be named) and better ones (like Disney when I did onshore work at Florida). What I realized is that you can never get the best chair. You sit on a different chair and then it feels better, and after a while it feels just like the other one.

Sitting all day is not healthy no matter how good your posture is or how comfortable your chair is. What I like about my cheap chair is that it doesn't take too much time to realize that I need to stand up, take some walk and stretch a bit.

It also reminds me to always be thankful that I'm doing the work that I love the most, and being paid for it. When I think about that and other comforts that I am enjoying, a chair is such a little thing.

Surely I can't sit on this chair all day, but that's actually a good thing.

Multiple login types on CakePHP 2

The Authentication component has been rewritten on CakePHP 2. I think it's not as simple as the previous version but I guess it's better going forward since there are multiple ways of authentications nowadays especially when creating API's.

If you need to create multiple login types on the same website, it is actually simple. You may need this in case you have 2 separate tables for 2 different types of users accessing your website. One way to do this is to use a different session key for each login type:

if ($loginTypeOne) {
  $this->Auth->authenticate = array(
    'Form'=> array(
      'userModel'=> 'TypeOne',
  AuthComponent::$sessionKey = 'Auth.TypeOne';
} else {
  $this->Auth->authenticate = array(
    'Form'=> array(
      'userModel'=> 'TypeTwo',
  AuthComponent::$sessionKey = 'Auth.TypeTwo';  

I also posted this on this thread on StackOverflow.

Thoughts on Read Later services (Pocket/Instapaper) and Send to Kindle

Just wanted to share some comments I posted on Hacker News about read later services and the Kindle (i'm xtimesninety on HN):

I'd love an e-ink android tablet too. Reading on an LCD tablet is painful especially if you are already staring at a computer all day. I almost decided to buy the Nook Glow because I've seen it installed with android 2.1 but it seems most apps are incompatible, so I went with Kindle Paperwhite which does web articles pretty fine with it's Send to Kindle feature.

Btw there's a chrome extension of Send to Kindle so you don't have to email articles. Also if you like reading Hacker News on the kindle browser check out :)

I actually stopped using Pocket (phone/tablet) and just use Send to Kindle for everything. It doesn't bother me too much that I can't archive/mark as read articles, I just delete them from my kindle once I'm done. Also I just order the articles by most recent and just use search if I need to find a specific article. I wanted to avoid relying on hacks so I guess this setup will be stable for a while.

It's actually amusing that since back then I've used ipod touch, android phone, android tablet, and now the kindle, for specifically reading articles from the web. When I was in college I was actually printing web articles in batch during weekends, I just paste the plain text to MS word arranged in 3 columns in uniform font so it looks like a newspaper. Those were fun times since everything was so new to me :) that's way before all the instapaper/pocket came out.