Can protocol buffers improve the speed of your website?

Recently, I started doing research into protocol buffers and decided to run performance tests to see if they are a viable option for reducing server response time over traditional JSON APIs. As I am new to protocol buffers, I made a demo site to test the different API types. See it here.

Topics: Developer Tools

How to update window styling on the fly using doT.js

In this post we will discuss how you can use doT.js, a fast and lightweight template engine, to re-render window styling on the fly. We recently used doT.js in a custom theme editor we built for one of our apps. We used doT.js in two ways:

1. We were able to store predefined color themes as JSON objects on the server which could then be converted into CSS on the client side and applied to all windows.

2. We were able to change the color of a specific element in real time as a user dragged their mouse over a color palette. In this post we will go through how to complete part 1 and in a later post we will explain how to complete part 2. 

Topics: Developer Tools

JavaScript and LINQ

LINQ, or Language-Integrated Query, is a library that allows a user to easily query and update data. LINQ originates from C# and Visual Basic, but I have found it to also be a useful tool in JavaScript (linq.js), as it is great when dealing with tabular data sets.

How to mock web servers using Node.js - Part 2: Websockets server

In Part 1, we explored how to mock web servers with Node.js using HTTP. In Part 2, we create a WebSockets server to allow for full-duplex communications between the client and server. The great thing about the node project is that with a single project we can create as many servers as we would like. So, we can continue to use the project from part 1 to build our second server.

How to refactor code

I have always been a fan of refactoring, ever since my intern days. My earliest coding sessions were always reviewed and refactored by a more experienced mentor. I still push for weekly sessions, which include discussions on design and direction, as well as deep dives into refactoring. But how exactly does one refactor? Below I have listed the four essential steps to do so.