javascript
-
Handling Callbacks with a Depth-First Tree in JavaScript
2 minutes - Apr 20, 2015
One of the hardest things to do in JavaScript when working with complex data structures and a callback oriented platform is to know for sure when all of your callbacks have been fully executed. This issue came to light when working with a MongoDB datastore that was being used to store an infinitely-deep nested menu structure. This menu structure could be visualized as being a tree. In order to get the all of the needed menu items from this tree, a depth-first traversal of the tree was determined to be the easiest to track. -
Don't Use MongoDB For The Wrong Things
3 minutes - Apr 7, 2015
The early phases of a greenfield project always seem to conjure up grand ideas of how to use the hottest new technologies to accomplish your goals. Many times, these grandiose plans give way to a more level-headed design discussion where more realistic technologies are adopted. However, there are a few times where the developer with the idea to use the hottest new technology is the one in charge, and ends up getting his way. -
Social-Buttons.Com Spams Google Analytics
One minute - Apr 2, 2015
Typically when you see traffic in Google Analytics, you can be sure that it is legitimate traffic to your website. However, there are a few known spammers out there that successfully spam Google Analytics tracking codes with bogus visits, hoping that the Analytics users visit the site that is supposedly “referring” traffic. One such domain that is being used for this is Social-Buttons.com. I have just begun to see traffic in Google Analytics from Social-Buttons. -
Optimize Wide To Narrow
2 minutes - Mar 30, 2015
If you consider the path that a user takes through your website from landing page to successful conversion, you can think of the number of users that make it to each point along the way to a successful conversion as similarly shaped to that of a funnel. In a typical setup, you may have a very small percentage of your users make it to a successful conversion, but there are several areas along the way that either improve the chances the user will convert or decrease those chances. -
Another Micro-Optimization Provides Useless Results
2 minutes - Mar 26, 2015
One of the things to remember about performance optimizations performed in isolation is that their results are rarely representative of real-world performance results. This article outlines the “findings” of the students at a couple of Canadian universities, and comes to the conclusion that string concatenation in memory is slower than writing the same total number of bytes to disk, one after the other. String concatenation is a slow and CPU-heavy operation. -
Google Chrome Improves JavaScript Speeds Again
2 minutes - Mar 23, 2015
One of the old rules of optimizing website load times for all browsers was that the browser didn’t begin to parse the downloaded JavaScript until each file was downloaded. Starting with Chrome 41, Google has announced that this is no longer the case. In this announcement, Google has said that new versions of Chrome will begin parsing JavaScript as it is downloaded to the browser, even before the particular file’s download is complete. -
Google To Begin Rewarding Mobile-Friendly Websites
One minute - Mar 20, 2015
Google recently announced that beginning April 21, 2015, they would start slightly rewarding websites that are mobile-friendly at the expense of sites that are not. There are several things that Google looks at to determine whether or not a site is easy for a user on a mobile device to view and navigate. Some of the things that Google looks for include the following: Fonts that are big enough to be legible Users don’t have to scroll left and right to see content Links are big enough and have enough space around them to be clickable with a touch of a finger. -
When Is Enough CSS Enough?
2 minutes - Mar 17, 2015
One of the major pushes in web development today is to try to do as much of the styling of a website as is possible from within the CSS of the site. The idea behind this is that when you do so, you remove styling responsibilities from your JavaScript and HTML content, resulting in a much better separation of concerns. The other aspect of this is that CSS styling is typically handled in a more native fashion in the browser as compared to what you can accomplish via Javascript. -
Google Code Shutting Down
2 minutes - Mar 16, 2015
Google just recently announced that they are going to begin the process of shutting down their Google Code project hosting service. In the blog post announcing that they were shuttering the service, they let it slip that even Google had quit using Google Code for their project hosting, instead transitioning thousands of their projects to GitHub. Google seemingly blames the fact that GitHub and BitBucket handle project hosting better than Google does as the main reason that they are discontinuing the service. -
Never Explicitly Trust Software Because It Is Open-Source
3 minutes - Mar 13, 2015
One of the major ideas behind open source projects is that allowing anyone that wants to view the source code of a project to be able to do so should make bugs and security weaknesses easy to find. While this did not work so well with OpenSSL and its various bugs that have been exposed recently, I do have an example where it worked extremely well. Magento is an eCommerce platform that has two separate editions.