Using Adobe Edge Inspect for Cross-Device Web Page Debugging and Synchronized Browsing

Using Adobe Edge Inspect you can inspect your webpages (like you do in chrome dev tools) across various remote devices (mobiles, tablets, etc.). You basically connect multiple iOS or Android devices to your computer wirelessly (this happens via adobe’s servers). Then all you do is browser in your Chrome and those devices will stay in sync, i.e., open/refresh the webpage that you’re viewing in chrome. You can then fire up an inspecting tool (in your computer) to inspect html, css and do a lot more (like dev tools) in those devices. The inspection is done via weinre.
Continue reading “Using Adobe Edge Inspect for Cross-Device Web Page Debugging and Synchronized Browsing”

Browser-Side Node.js Style Modules require() and exports with Browserify

Browserify is an excellent tool that lets you use CommonJS modules right in the browser by bundling them up into a single large file. If you are well acquainted with Node and it’s way of loading modules via require('module') and exporting them using module.exports = ..., this is the exact pattern browserify brings to the browser. Not only can you write your own modules in this format and load/export them, but you can also use those installed via npm!

Continue reading “Browser-Side Node.js Style Modules require() and exports with Browserify”

Weighted/Biased Random Number Generation with JavaScript based on Probability

weighted random post image

First of all what is weighted random ? Let’s say you have a list of items and you want to pick one of them randomly. Doing this seems easy as all that’s required is to write a little function that generates a random index referring to one of the items in the list. Sometimes plain randomness is not enough, we want random results that are biased or based on some probability. This is where a simple weighted random generation algorithm can be used.

Continue reading “Weighted/Biased Random Number Generation with JavaScript based on Probability”