BLOG

standard

How to stop repainting your sticky bar on scroll?

14.04.2015 Posted in Knowledges No Comments

Everybody loves sticky bar. Or I should say every UX loves sticky bar. You probable have seen that from almost all major websites. Twitter or Facebook all has the top nav bar which sticks to the top and follows you when you scroll down the page. However, there’s one thing that I have noticed if you use Google Chrome Dev Tool to see the paint area. You will see that the nav bar gets repaint every time you scroll up and down.

Screenshot_2015-04-14_01_13_55

Also, if you use Timeline to record the activity you will notice a lot of Repaint happening which leads to bad scrolling performance.

The easy fix would be to put

1
backface-visibility: hidden;

on your navbar which will stop the repaint on scroll.

Why that fixes it?

I don’t want to try answer this myself as this article answers everything.

Try it yourself

http://noppanit.com/navbar-repaint.html If you put

1
backface-visibility: hidden;

to the navbar and you can measure the performance by using Timeline again you will notice the difference.

Screenshot 2015-04-14 01.20.04

standard

You should check in your dependencies.

28.03.2015 Posted in Knowledges 2 Comments

I’m not sure who started this pattern so I can’t really refer back but if you know please comment below and I will update the post. I’m sure all of you have heard that you should not check in anything that can be generated to Source control. It’s long been a common pattern. However, lately I have been checking in my dependencies into my source control and it works really well for small to medium project. Here’s why.

Isolate you from any network failures.

I know you might say that it rarely happens to me so why should I care about this. I hear you. It rarely happens to me as well but when it did happen I got really frustrated. Especially, when your CI failed without any reason and you found out that one of your dependencies doesn’t get downloaded properly.

CI failure

This frustrates me the most and it’s one of the reasons why I started doing this. More than often that my CI failed and it’s because of dependencies didn’t get resolved or compiled properly and people just kept running it over and over again. To eliminate this problem and let CI just run the tests save me a lot of pulling my hair time.

Check out and Go!

This pattern I have learnt while I was working with ThoughtWorks that it’s so frustrated when you are joining a project and you spend almost half a day just to get your machine up and running and run the build script to download all the dependencies. I believed that’s one of the reasons why Chef and Puppet exist. It’s so easy when you checkout a project from your source control and you can start coding right away or even run all the tests.

I also have this support from my friend

Srini also pointed out that you shouldn’t do that for internal project dependencies

Conclusion

I know people might argue that it doesn’t really work for big project because of the size of the repository. That’s why I mention small to medium project. It works really well with small projects. Another point to mention is that every developer might have different environment for example, Windows VS Linux which node_modules might not work for both environments. I solve that problem by using Vagrant so everybody has the same environment.

Inspiration
https://www.dzombak.com/blog/2014/03/including-pods-in-source-control.html

standard

My 2015

5.02.2015 Posted in Knowledges No Comments

I just want to take a break from writing about technical posts to just talk about myself a little bit. I’m inspired by Scott Muc’s post about his 2015 Resolutions. Before getting into 2015 I want to take a step back and review my 2014

My 2014

  • I got the opportunity to work in Turkey as part of my consulting job with ThoughtWorks. I can count Turkey to be my 6th country I have lived and worked in. I used to work and live in Thailand, China, India, United Kingdom, Germany, Turkey.
  • Learned C#. C# is the first language I learnt at school when Windows Form was a big thing. I loved it but then the web took over and I felt in love with Java instead and never look back. The project in Turkey is C# so I got to relearn that again and I can say that I like it more than Java now. The language is nicer and more functional. I can do more stuff with less code.
  • Moved to the US.

My 2015

Move to the US and join Fusion

I decided to join Fusion and left my glamorous consulting job. Partly because of the city. I felt in love with New York City when I was there in 2013 for a conference and I thought it would be nice to live here. When the opportunity came I took it immediately. Now two months passed by and I still love the city and my job. Much to explore and lots of places to travel in the US. Fusion is also the first place I get to know what’s like to work remotely. I absolutely love it. I get to be anywhere and also do what I love which is coding. I will write another post about remote collaboration later. Fusion is a media company which is a new field that I haven’t explored before.

Join Kollaboration

I join Kollaboration New York as a Technical Director because of my roommate Tanner Chung. Kollaboration is a non-profit organization that help and promote Asian American artists through entertainment. In this organization, I get to learn what’s like to be Asian American. I’m asian myself but I was born in Asia. So, I didn’t know the problems a lot of asian people living abroad having.

What I want to do in 2015

Learn to invest

Who doesn’t want to have money? I’m going to learn how to invest my saving and will keep posting the results.

Travel across America

When I was living in Europe, you can get to a lot of countries in just 2-3 hours but in America everywhere is so big and South American has always been my dream location.

Learn Spanish

My previous goal leads to this goal. I speak Thai, English and Mandarin. I learnt German before but didn’t really get anywhere. This year I’m going to learn Spanish and make it my fourth language. I love languages and it’s fun to talk to the locals and amazed them with their language.

Run a marathon

My friend Rajveer and Srini inspire me to running. I’m a chubby guy and I really want to get into shape. Running a marathon takes a lot out of you mentally and physically. I thought if I could do it at least for once, I’d accomplish something.

Summary

I started off 2015 pretty good. I went to India for my friend’s wedding in Rajasthan. I went to US west coast to experience super cold whether. I learned PHP and WordPress and improved my JavaScript skills which I will continue doing that.