javascript

Get width/height of invisible DOM elements

When working with elements in jQuery, you might need to get width/height of certain invisible DOM elements. By default, jQuery would return 0 in this case because it can not calculate the actual height() of that element. In order to solve this problem, I take advantage of jquery.actual…

Long-polling with Puma, Rails 4 and Server Sent Events

In this post, I am going to show you how to create a long polling server with Puma, ActionController::Live in Rails 4 and Server Side Events in modern browsers. Why there is another post when there are already many of them on the Internet? It is just because I…