Nike+ FuelBand

I’ve been using FuelBand for three days now and here’s my two cents.

FuelBand gives you a number (Fuel score) that tells you how active you have been throughout the day and motivates you though trophies, badges and so on to keep on beating that number. A silly concept that works and really gives you motivation to move more. Today I walked 2km to the tram station instead of taking the bus that stops nearby — just because it was already dark and I still had about 500 NikeFuels left to reach my daily goal. Kudos to Nike for that.

But as much as I like that, I don’t like how it measures calories and steps — it doesn’t allow for entering explanation of activities and the very fact that you can sit on your butt and just wave hands to increase the calories counter proves it is inaccurate. 
It also fails as a watch — you can’t just glance at it and see the time. You have to double click the button and if you don’t do that quick enough you’ll have to scroll the other information parameters, so I’m sticking with my old Casio watch.

FuelBand so far has done for me what it should do. It inspires me to meet my daily goal and lets me know that I am sitting behind the computer too much and should get off my arse. But it is definitely in his infancy and I wouldn’t recommend it to a non-geek.

TL;DR. This thing is good for non-fitness office rat like me who wants to improve their health with exercise. Yes, not accurate on calorie and steps count, but that’s not what it has been built for.

Setting up Sublime Text for Ruby development

Sublime Text 3 (ST3) is a lightweight, cross platform, blazing fast text editor with Chrome-like tabs and split window layouts. There is a relatively huge amount of support for it, because there are many who have fallen in love with it. At last count there were over 1,300 “packages” available for it to enhance its functionality, appearance, and general usability. Once you have a few settings tweaked and packages installed, which is a very simple process, you’ll really come to like Sublime Text. And you will need to set up some preferences, because out of the box it’s pretty standard. It’s so easy, I’ll just tell you quickly how to do that now.

Why Sublime Text?

After switching from PHP to Ruby half a year ago I was looking for a new IDE to replace NetBeans. I’ve tried RubyMine and realised that PHP’s verbosity is why I went for NetBeans and I no longer need a monstrous IDE with Ruby, a plain text editor will be fine. I used Ubuntu at the time and Sublime Text 2 was the best option. Having tried TextMate on my MacBook, I went back to Sublime Text. You should switch to it, especially if you’re using TextMate.

Getting Started

Here are the steps I usually follow to take a new ST3 install from good to awesome:

  1. Install the subl command line tool. Assuming ~/bin is in your path:
    ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl

    On Ubuntu, I recommend installing ST3 from PPA, it will spare you from symlinking.

    Optionally, you can now make Sublime Text the default editor for git:
    git config --global core.editor "subl --new-window --wait"

  2. Install Package Control. Package Control makes it easy to install/remove/upgrade ST3 packages.

    Follow these instructions and reboot ST3 when done. (You only need to do this once. From now on you’ll use Package Control to manage ST3 packages.)

  3. Install the Soda theme and RailsCasts color scheme. This dramatically improves the look and feel of the editor.

    Use Package Control to install Soda:

    • Press ⌘⇧P to open the Command Palette.
    • Select “Package Control: Install Package” and hit Enter.
    • Type “Theme - Soda” and hit Enter to install the Soda package.

    Do the same for the package called “RailsCasts Colour Scheme”.

  4. Start with a basic Settings file. You can use mine, which will activate the Soda Light theme and RailsCasts color scheme. Reboot Sublime Text 3 so the Soda theme applies correctly. You can browse the default settings that ship with ST3 by choosing Sublime Text > Preferences > Settings - Default to learn what you can configure.

  5. Install more packages. My essentials are All Autocomplete, BeautifyRuby, ChangeQuotes, CoffeeScript, SideBarEnhancements and GitGutter. GitGutter shows whether each line has been added, modified, and where lines have been removed.

Leveling Up with Custom Commands

Sublime Text makes it dead simple to write your own commands and key bindings in Python. Here are some custom bindings that I use:

  • Copy the path of the current file to the clipboard. Source
  • Close all tabs except the current one. Source
  • Convert Ruby 1.8 hashes to Ruby 1.9 syntax. Source

New key bindings are installed by dropping Python class files in ~/Library/Application Support/Sublime Text 3/Packages/User and then binding them from Default (OSX).sublime-keymap in the same directory. You can use mine as an example.

Getting your hands on a keyboard shortcut cheat sheet is recommended, although you can of course set your own key bindings as you want them. Knowing keyboard shortcuts separates the men from the boys, and increases your productivity exponentially.

Code Navigation

Sublime Text 3 introduces symbol indexing, which works by scanning all files in the project folder. The new Goto > Goto Definition and Goto > Goto Symbol in Project options let you quickly navigate to code definitons (classes, methods, etc.). You could get the same functionality in ST2 by installing CTags.

There is one small change needed for it to work nicely with Ruby’s bang! and predicate? methods. Put this in your settings file at Sublime Text > Preferences > Settings - User:

"word_separators": "./\\()\"'-:,.;<>~@#$%^&*|+=[]{}`~"

This is the default setting without exclamation and question marks and is needed for ST3 to treat them as part of the word.

Conclusion

As you can see, Sublime Text is not a fully featured editor from the beginning. But exten­si­bil­ity is one of its great­est fea­tures, among many great ones. I hope this setup guide was helpful to you. If you’ve got any comments or suggested improvements, let me know in the comments below or drop me a line on Twitter.

The blog was moved

Right after Yahoo acquired Tumblr, I decided to move my blog somewhere safe.

Despite their frank promise that it will not screw up Tumblr, I’ve learned the lesson of giving up on things before they have a chance to disappoint you.

I’ve finally found time and am about to start my journey with Posthaven.
I really like its minimal look and, fortunately, they are paid service. This means their users are customers, which leads me to believe in their pledge to never get acquired.

All new content will be posted here.

Zend PHP 5.3 Certification

I am happy to announce that yesterday I passed Zend 200-530 exam at Fast Lane, a Pearson VUE exam center here in Kiev, and became a Zend Certified Engineer.

I gave myself a relatively short timeline to study for the exam (3 weeks) and take it, and for the most part just studied the PHP.net manual focusing in on what was mentioned in the study guide.

The exam is composed of 70 questions that you have to answer in 90 minutes. Overall I find the time sufficient enough, it took me only 50 minutes answering all the questions. My exam strategy was to pass through all the questions answering what I can, as fast as I can, marking certain questions that I was unsure of for later review.

I can’t talk about questions and answers because of the non-disclosure agreement I had to sign, but I can write a list of things you should know if you want to pass the exam:

  • What typehints are, how they work, and where they’re applied.
  • What all of the array_*() functions do. The more verbose array_*_*() functions can be safely skipped over.
  • How to use the SimpleXML library in a very general way (access elements, attributes and convert to DOM).
  • What streams, filters and sockets are, how to use them, how to open/close file handles, how to write/append/read to/from files and implications of the file locking mechanism.
  • What XSS, CSRF, SQL injections, email header manipulation, remote code injection are and how to reduce the threat.
  • Everything about the object model, including abstract and final classes, the new constructor format, destructors, autoloaders and access specifiers (public, private, protected). Difference between ‘self::’ and ‘static::’. Difference between interface and abstract class.
  • How and when to pass by reference.
  • What the following php.ini directives do: allow_url_fopen, register_globals, enable_dl, disable_functions.
  • What goes in the superglobals and when.
  • Operator precedence and what all of the bitwise operators do (you should also be able to convert numbers to and from decimal, octal, hexadecimal and binary notation with nothing but your brain and a piece of scratch paper).

Programming languages are like girlfriends: the new one is better because *you* are better

The main reason that any programmer learning any new language thinks the new language is SO much better than the old one is because he’s a better programmer now! You look back at your old ugly PHP code, compared to your new beautiful Ruby code, and think, “God that PHP is ugly!” But don’t forget you wrote that PHP years ago and are unfairly discriminating against it now. It’s not the language (entirely). It’s you, dude. You’re better now. Give yourself some credit.

— Derek Sivers

Farewell Tiptopen

Well that’s all, I am no longer a part of Tiptopen.
I worked there for six months and I can say that these months were the best in my life.

I loved my job.
It was different every day and I enjoyed working with amazing people that I call my friends today.
It has been an honor to serve with you, guys.