Choosing the best numbers in nfl football squares to beat your friends

The Super Bowl Square gambling game is all luck, right? Not according to our calculations. An analysis of all 2,312 NFL games since 2009 revealed…. read more

compare your united states income

how to generate time series aggregations in MongoDB using Unix and Epoch timestamps

ECMAScript5 introduced Date.now(), a method that returns the milliseconds elapsed since 1 January 1970 00:00:00 UTC up until now as a Number. Date.now() is the fastest way to record a timestamp in JavaScript[1], [2] and as such, usage will continue to increase as developers become educated in speed improvements. While speed improvements are important, storing Unix / Epoch timestamps in MongoDB…. read more

how to write data to the beginning of a file with node

Screen Shot 2015-01-17 at 6.38.24 PMRecently I have had to do a lot of work building infrastructure converting data from .json to .csv. One challenge that presented itself was figuring out a way to prepend / write data to the beginning of the .csv file. There are plenty of use cases for prepending information to the beginning of a file, however in my specific use case I needed to count the number of times a variable existed…. read more

how apple can catch up to google ratings and yelp reviews overnight

Screen Shot 2015-01-17 at 6.38.24 PMYelp. The word is synonymous with ratings. Although Yelp is very powerful and has millions of reviews, they have not gained my trust. There are tales of paid Yelp reviews, compromised Yelp reviews, even extortion. To use Yelp, I need to stop everything I am doing, quit my current app, open up the Yelp app and search for the name of the location of interest. This is one of two common scenarios… read more

best and worst times to take an uber in SF, LA, and NY

Screen Shot 2014-11-30 at 6.23.53 PMAbout two months ago, Nicolas and I were curious to see if we could nail down the cheapest and priciest hours to order an Uber. To do this, we requested pricing data from Uber’s developer API at ten minute intervals in three major cities (San Francisco, Los Angeles, and New York) using a node.js / Express server and used Keen.io (amazing tool) for event storage. We selected three points of interest … read more

how to create adaptive pie charts with transitions in d3

Following up with my last blog post about adaptive line chart graphs (link), I decided to apply this same concept of adaptive charts to a pie / donut chart. The goal is to create a chart similar to the one below, which updates to any new data thrown at it.

For this example, we need to create a single dimensional dataset. Typically pie / donut chart data would be multi-dimensional, at the very least, because … read more

how to create live updating and flexible d3 line charts using pseudo-data

One of the bigger challenges in visualizing data is making your charts responsive so that they can resize no matter what range of data is thrown at it. Things get even more complicated when the dataset is actually a collection of many individual sets of data. One obvious example of this is a dataset containing (x,y) coordinates for multiple lines. The goal is to create a chart similar to the one below, which adapts to any new data thrown at it.

The best way to test the functionality of your graph is to generate new pseudo-data at a set interval and update the graph at the same interval. I had previously blogged about how to generate large datasets using d3 and … read more

how to modify, filter, and save JSON files locally using jQuery

There are many API’s available for use, many of which are free and provide lots of fun data to play with, however there is one common hurdle to overcome with each; the structure in which data is returned from the database varies greatly with each API… read more

how to quickly create randomly generated datasets in javascript with d3

Often times in javascript and D3, we want to quickly create randomly-generated, “fake” data on the fly for testing and iterative development. To help speed things up, we can combine the d3.range() operator and the native Array.map() prototype to make up large data sets instantly… read more

using .reduce() to create arrays and objects in javascript

I love functional programming and things just got better because of reduce and reduceRight.  In ECMAScript5.1, the Ecma integrated some really common array mutation operations from some popular libraries (underscore, lodash, …) and made them available natively in JavaScript. The two that I really love are Array.reduce() and Array.reduceRight() because… read more

how to use the uber api to get pricing data

Uber opened up their API to developer and as a fun experiment, I decided to play around with the Uber API, collect a few days worth of data and see if any trends were apparent (http://jonsadka.github.io/uberAnalytics/). To make a successful pricing data request,… read more

fight on! javascript closures

The term closure is often thrown around a lot in the javascript community however there seems to be a misunderstanding of what this term really means.  A closure in javascript does not refer to a specific function, but rather the way in which that function accesses… read more

prototypal and pseudoclassical instantiation

In javascript, there are four ways to instantiate a new object.  This blog post will cover the differences between the prototypal and pseudoclassical instantiation patterns; functional decorator and functional-shared instantiation patterns will not be covered in this… read more

d3 type coercion

D3 is an amazing platform that allows software engineers to bind data to each DOM element that exists, or will be, created.  This data can then be used to compile graphs, charts, or any other visual means. Last week, I had the opportunity to play around with D3 and… read more

supercharge your falsey && conditional statements in javascript

Over the past few days, I have discovered the large potential of falsey values (false, 0, “”, null, undefined, NAN) to provide direction and simplify code in javascript.  If used correctly, one can replace multi-line logical expressions with logical operator… read more

configuring custom domains on azure using namecheap

Azure is a very powerful cloud platform that allows you to host pretty much anything on Microsoft’s servers in the cloud.  For me, this means setting up personal/business websites and hosting them on Microsoft’s servers. However, the one caveat … read more

github contributions to date

  • javascript related posts 88%
  • d3 related posts 44%
  • api related posts 19%
  • ux / ui related posts 6%
  • deployment related posts 6%
  • jquery related posts 6%
  • mongod related posts 6%

follow me here[et_social_follow icon_style=”slide” icon_shape=”rounded” icons_location=”top” col_number=”auto” custom_colors=”true” bg_color=”#b66982″ bg_color_hover=”#da785f” icon_color=”#e8e8e8″ icon_color_hover=”” outer_color=”dark”]