Skip to content

Instantly share code, notes, and snippets.

View chaotic-stump's full-sized avatar

Stumpy chaotic-stump

View GitHub Profile
@chaotic-stump
chaotic-stump / rails_exercise.rb
Created September 14, 2023 18:17 — forked from rhelsing/rails_exercise.rb
rails exercise
# Background:
# The following code works but I have intentionally introduced issues to make it inefficient.
# UserEvents are created for every interaction a user has in the system. It stores what employer, partner and
# controller they were on. When there were 10 users and only a little bit of traffic, this would run quickly.
# But now with 10,000 users and months of traffic - (millions of user events), this code would be very inefficient.
# Instructions:
# 1. Please make this code more efficient through refactoring so that it can run at a greater scale,
# along with adding some comments to improve the readability.
# 2. Please explain what the variable 'distinct_groups' will contain by the end of the execution and what
@chaotic-stump
chaotic-stump / .block
Last active July 16, 2019 12:38
horizontal barchart with tooltips
license: mit
@chaotic-stump
chaotic-stump / .block
Last active January 28, 2019 20:05
LineScale Gradient
license: mit
@chaotic-stump
chaotic-stump / index.html
Created March 2, 2016 14:20
succinct countdown
<div id="clockdiv">
Days: <span class="days"></span><br>
Hours: <span class="hours"></span><br>
Minutes: <span class="minutes"></span><br>
Seconds: <span class="seconds"></span>
</div>