Tuesday, November 26, 2013

5 Tips to Help you Build the Habit of Running Daily

This is the first post in a series dedicated for running, In this post I want to share with you tips I found useful to build the habit or running daily:


1- Early to bed, early to rise
Force yourself to wake up early, around 5:00-6:00 AM. This will in turn force you within a week or two to start sleeping early too.

2- Be ready the night before
Have your running clothes all set up next to your bed the night before, so when you wake up you just grab it and go.

3- Eat Carbs
Have a quick small portion of something with carbs to eat, I have a granola bar or fruit yoghurt.

4- A trip to the loo
Visit the bathroom, it's always much easier to run on an empty stomach and it helps you regulate your bowel movements.

5- Stretching, 15 minutes shower, Cold-Hot-Cold Shower
After the run, make sure you stretch properly and take at least 15 minutes to cool off. A Cold-Hot-Cold shower is amazing for refreshing you, relaxing the muscles, reducing inflammation in tendons. After which you will feel as if you didn't run at all.

Repeat 1 to 5 for the coming 30 days, do it no less than 5 times a week. I run Monday,Tuesday, rest on Wednesday then run Thursday, Friday and Saturday and rest on Sunday.
And I find having two days off (spread within the week) really good for rest and doesn't cause you to lose your momentum.

Happy running, have any questions or experiences or tips you want to share leave it in the comments below.

Monday, November 25, 2013

I Cannot Use Markup to Correctly Order Bidirectional Text... It's Driving Me Crazy


So you are facing the problem with bi-di text which is a piece of text that contains both directions ltr & rtl. And most probably you're using Arabic with English.

I'll start with the quick fix for those who just want to fix it & don't want to know more and then will provide links that will explain more about it.

Quick Fix:
So to solve this in your markup you add the following invisible characters in your markup
Arabic‮‭ English ‬ Arabic,

These characters will switch the direction to rtl,ltr and back again to rtl.

Example:
Check the examples in the fiddle below, to understand the solution better:
http://jsfiddle.net/3amzooo/ThKAE/1

Read More:
To gain a better understanding of the bi-di text, the algorithm used to render it and how browsers deal with it read the links below:
http://en.wikipedia.org/wiki/Bi-directional_text
http://www.w3.org/International/articles/inline-bidi-markup/
https://www.w3.org/International/questions/qa-bidi-controls
https://www.w3.org/International/questions/qa-bidi-unicode-controls

Comment below to let me know if this helped you solve a problem, or if you need any help solving a similar problem.

Thursday, November 21, 2013

Building a System of Continuous Self Improvement


So I'm not an expert on success, and I'm not the most successful person you will meet in your life. But in the past year or so I have realized that my life needs to change for me to be able to get somewhere with my life, achieve something.

So I started building a system that really transformed the way I live. Again I'm not an expert or anything close to an expert when it comes to productivity or self improvement, but these are the rules I followed, some I have picked from reading different books, some I just came up with and it helped me quiet well:

1- Pay yourself first:
I'm a father of two, and have a demanding job as a product architect and a technology manager in an e-commerce company with long working hours. And I have always found it hard to fit anything in my day. I used to convince myself that I'm a night person, used to sleep and wake-up late. Having that said, I have always thought that as a dedicated employee and a loving father, my job's and off-springs' needs should come before mine.

How wrong I was at that, after suffering from a thyroid disease for 4 years, I thought I'd give it a try and take care of myself first. I started waking up early at 5:30 AM for 5 days a week and go to to the gym; when everyone was sleeping and no one has any claim on my time. Then started reading regularly on my workout off days which is something I haven't done before in my life (since I got used to waking up early).

Now and after only a year, I have my first 4 hours of the day from 5:30 till 9:30 mostly dedicated to me. Building my stamina by exercising and, and my intellectual capacity by reading. And the funny thing is, my off-springs and employer could not be any happier, even when I show up late at work, I'm always fresh and productive. And I enjoy my time with my kids since I clear out the "me time" early in the day, and that makes them enjoy their time with me too.

2- Build good habits:
Building good habits is extremely hard work, but that's only for the first month. After you break the 30 day barrier doing the same thing everyday at the same time, it becomes hard not to do it. Keep that in mind while building habits and it will help you bare through the first adjustment period. Whenever you find your will waning, remind yourself "delayed gratification" is what makes human beings awesome. and it's only a month.

3- Combine the habits into a system:
Don't go changing your life all of a sudden; you will fail miserably. And that's something a friend of mine once told me. I'm the kind of person who used to get impulses to change his life drastically and always failed to do so. The trick is in building a system gradually, build one habit at a time, 2 at max and these two habits need to support each other.

4- Measure, Set Goals & Persevere: 
Don't just go about building habits without having a way to measure how well you're doing. Today technology makes it much easier to measure your performance in nearly everything you do. Set ambitious goals but put a workable plan to achieve it.

At the beginning of last year I thought how hard would it be to run a 1000 Km before the end of the year. It felt and sounded really hard if not impossible, but once broken down it meant, if I managed to run 200 days out of the 365 days in a year and run 5Km each time I would make it. And I set a daily goal of 5 Km. At first sometimes I had to walk to finish the 5Km; now I run faster than I ever did and I run 6-7 Km everyday.

I wanted to read more, and I set a goal of 2 books a month, that's not much and I listen to another 2-3 audible audio books while exercising.

5- Invest in your own well being:
Get yourself accustomed to spending on your good habits, I used to be a smoker for 15 years buying 1-2 packets a day on average, and I always thought that paying 5 USD on a book is expensive. After setting priorities straight I feel happy when spending money now on food supplements, books, running shoes; since I always remind myself that this money is going into building a better me.

6- Honesty with one's self (make no excuses):
We always tend to blame others for our problems and short comings, at least I did. One thing that changed my perspective is the belief that you are responsible for everything that happens in your life. If you want people to treat you well, value you or care about you. You need to start by doing it to them even when you think they don't deserve it. Do not make excuses for yourself, nothing justifies you not following through with your plans. "Argue for your own limitations and they become YOURS". 

Finally, the year is still not over, but nearly there. Following those simple tips above I managed to do the following things this year, and many still to come:

AspectYear StartYear End
Reading Books1-2 books a yearOver 20 books , and 30 audio books till now.
Runningcouldn't do 5Km to save my lifeI run 10 Km in 49 minutes, and I have run 1200 Km till now.


Wednesday, November 20, 2013

Logo Design For 3asafeer.com

3asafeer.com logo


My own work, a logo for an Arabic educational website for kids I'm working on.

If you happen to pass by the blog let me know what you think about it.

EDIT: After Some feedback tried to do some adjustments on the logo, second picture has more shades & different outline colors.

Monday, November 18, 2013

Creating A Personalized Experience for Your Site Visitors: How to Detect Visitors' Country


So this is the first blog of a series on how to create a personalized experience for your website visitors. This part of the series will take care of getting and using the country of the visitor through 2 different ways:

1- HTML5 Geo-Location:


How it works?
As part of the html5 specification browsers need to support this functionality. And although both chrome and firefox use the google geolocation service in their implementation, the implementation can be done in different ways in the future following the specs. I have read somewhere that the Safari on IPhones actually uses the GPS on the device to provide the location information instead of WiFi-triangulation or cell-site geolocation.

Pros: 
  • Can get you more accurate information, you can get latitude and longitude of a visitor, so you can tell the city and even the street they are in.
  • Following the html5 specification, hopefully in the future the browsers implementation will be more solid than it is today.

Cons:

  • Will prompt the user asking to share location information. in the case of getting only the country, this could be an overkill. 
  • The prompt is shown in different places in different browsers and can go unseen which creates a horrible user experience IMHO.
  • Troublesome to code.

Example:
Check the fiddle in the link below for a simple example on using html5 geolocation:
http://jsfiddle.net/3amzooo/7ZA7p/

Read More:
http://www.w3schools.com/html/html5_geolocation.asp

2- Use of an IP range DB service API:


How it works?
This method works by storing IP ranges that belong to each country in a database, once you query using the visitors IP, it will return the country that is assigned the IP range that the IP your inquiring about (visitor's IP) falls within . 


Pros:

  • Quick method, doesn't need user consent.

Cons:

  • Might sometimes get wrong information since it's based on the database of IP address Ranges associated with each country.
  • Cannot get detailed information like latitude, longitude.
Example:
Check the fiddle in the link below for a simple example on using an API that uses a database to tell the location:
http://jsfiddle.net/3amzooo/kG4vC/

Read More & Resources:
http://freegeoip.net/
http://dev.maxmind.com/geoip/legacy/geolite/