Skip to content

Instantly share code, notes, and snippets.

@maxp-edcast
maxp-edcast / group_daily_scores_query.md
Last active March 9, 2018 05:25
group_daily_scores query

We have user_scores_daily created every day for every user. Each of these records has a _user_id tag and some numeric fields.

Each user belongs to multiple "groups" (i.e. teams).

We also want to get group_scores_daily, which containns the sum of user_scores_daily fields for all users in each group (per day).

We currently do this in a background job with Ruby. It runs every day and combines data using two separate Influx queries.

  1. We get a mapping of group_id => user_ids
@maxp-edcast
maxp-edcast / notes.md
Last active February 26, 2018 17:31
User scores notes
tags: user_id=1028
time                total_user_score smartbites_commented_count smartbites_completed_count smartbites_created_count smartbites_consumed_count smartbites_liked_count total_smartbite_score time_spent_minutes
----                ---------------- -------------------------- -------------------------- ------------------------ ------------------------- ---------------------- --------------------- ------------------
1519603200000000000 4
@maxp-edcast
maxp-edcast / subclass_through_module.rbb
Created January 17, 2018 05:21
subclass through module
module Subclass
def self.included(base)
base.const_set "Subclass", Class.new
end
end
class Foo
include Subclass
end
@maxp-edcast
maxp-edcast / source.txt
Last active November 11, 2017 04:31
test.md
### AWS setup
#### General setup
1. Make sure python 2.7 is installed:
- `python --version`
2. Make sure pip is installed
- `brew install pip`

asdasdasddsvsd