Working with gh-pages

Hosting
This week, we were introduced to the "gh-pages" which is one of the  coolest feature on github that enables you to host your static web content on github for free! the setting up for this is very simple, you only need to create a repo using your github account and then add master or the gh-pages branch to this repo then you can commit and push your html or any web content related files onto your master/gh-pages branch then your website will be available on github. After many researches on where to host your website, I think gh-pages may be the best option for me, simply because I don't want to spend a penny for hosting my website.



This is just a simple static html file I put on my github host. Right now the domain name is using the github defaut standard, and you can actually customize that domain name in the settings tab under your repo.

Code Reading
Basically, this page is a static page that display a result of a test on the onload event of a ima tag. every time the src attribute of a image is changed the onload event should always be fired. how ever when I was testing with chrome and firefox browser, the onload event was only fire for the initial loading which is weird. And I looked into the source code of the chrome browser trying to find the part where the onload event is being fired. Unfortunately, the code is so huge and I could not find the proper place where the image onload behaviour is being defined even I tried so hard. Maybe I have to set up the dev environment to inspect deeper into the code to see how the images are being loaded.

Testing
Writing test code was actually more interesting than than what I thought. especially when you are using testing framework like karma/jasmin or mochas that gives you the ability to "Simulate" the environment where your code is running  and you can create different test case for many circumstances.

Comments

Popular posts from this blog

Documentation in opensource