Pre-calculating vaccine ingredients: from PostgreSQL to HTML data-*

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

The VIC pre-calculates ingredient amounts in order to dramatically speed-up performance.  This article describes how its done and why AJAX would be the absolute worst way of doing dynamic calculations on a complex set of variables.

The VIC delivers a tiny database to the browser inside the Ingredient Report page. The data is stored as HTML data-* and the engine is Javascript. “By adding data-* attributes, even ordinary HTML elements can become rather complex and powerful program-objects.” [1]

Once the Ingredient Report is loaded…

Continue reading “Pre-calculating vaccine ingredients: from PostgreSQL to HTML data-*”

Experimental features: randomized slowdowns + retweet chains

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

Normally, Autovist broadcasts every hour at a random time within the hour.  I created a new Twitter account for Autovist itself, but don’t want hourly tweets yet until we build up at least 100 messages.  Autovist already has a built in check to make sure the same tweet is not broadcasted within the same 12-hour period.  But I wanted to add some randomized behavior on top of that:

Continue reading “Experimental features: randomized slowdowns + retweet chains”

Disable Spring when debugging gems

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

I spent a good 45 minutes puzzled as to why byebug wasn’t working from within a gem I’m debugging.  Even more confusing was that when I set byebug in the gem code along with some debugging code, and stepped into the gem, I saw my code edits along with the call to byebug… but the new code was never reached, it was as if it was being skipped right over.  Odd.

Went for a cup of coffee and to ponder this….

Finally, I figured out that spring was preloading the app and keeping the gems loaded – even after I changed the gem code.

For now, I’m going to keep spring disabled by setting DISABLE_SPRING=1 in my .env file.

Keeping the Autovist Dashboard Fast… and a surprise discovery

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

While performance tuning the database to solve Dashboard timeouts, we made a surprise discovery about how tweets and their embedded URLs are actually being used.

Continue reading “Keeping the Autovist Dashboard Fast… and a surprise discovery”

Create custom URL-click tracker in less than 5 minutes

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

Google Analytics is a powerful tool when your site has thousands of visitors a day or more. But it isn’t so good at showing you the most popular links on your site; nor does it allow you to work directly with the data your site generates and sends to it.

The reason we wanted to do this is because the Vaccine Ingredient Calculator’s Ingredient Report has a huge amount of links for more information and it would be really helpful to know the order in which our VIC users find them to be useful.  Depending upon vaccine choices, there could be up to 90 links!

Continue reading “Create custom URL-click tracker in less than 5 minutes”

Integrating Telegram Bots with Ruby on Rails

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

Here are the slides for a presentation I did at the DC Ruby Users Group on November 10, 2016.  The presentation is based upon a simplified version of an experimental Telegram Bot feature in Autovist …

Continue reading “Integrating Telegram Bots with Ruby on Rails”

Supporter Database and State-Level Legislative Strength

Chris Downey

Founder, VaxCalc Labs and creator of Autovist and the Vaccine Ingredients Calculator.

One of the most interesting systems I ever created was a Grassroots supporter database that:

  • combined multiple lists of donors, supporters, email subscribers and action alert subscribers
  • ran all addresses through Google Maps to show hot spots of support at state levels
  • obtained GIS coordinates via Google Maps API and ran them through Sunlight Foundation’s API to discover which state legislators represented the largest number of supporters and donors (where do we have leverage?)

The Grassroots supporter database helped the organization know which legislators they could most powerfully lobby via a larger number of supporters in their districts.

Here is a view of support across Virginia:

Continue reading “Supporter Database and State-Level Legislative Strength”