I hereby claim:
- I am afromankenobi on github.
- I am afromankenobi (https://keybase.io/afromankenobi) on keybase.
- I have a public key ASAgs52ACsRzWjg0fEsLXfnV-m42Bw0HnzBPzq6vLtv86Qo
To claim this, I am signing this object:
We used this query to find out the number of pg connections, | |
select count(*) from pg_stat_activity | |
We investigated and found out the there were multiple(upto 17) pg connections from 2 sidekiq processes | |
we have with 40 concurrent threads. | |
We used this query to find out sidekiq pg connections, | |
select pid, usename, application_name, state from pg_stat_activity where usename = 'ringmdstaging' and application_name like 'sidekiq%'; |
docker image ls | grep none | awk '{ print $3}' | xargs docker image rm -f |
I hereby claim:
To claim this, I am signing this object:
# Cards | |
class Card | |
attr_reader :kind, :rank | |
def initialize(kind, rank) | |
@kind = kind | |
@rank = rank | |
end | |
def to_s |
/* Average score per student */ | |
SELECT | |
members.id, members.name, courses.id, courses.name, avg(evaluations.score) | |
FROM evaluations | |
JOIN members ON evaluations.member_id = members.id | |
JOIN tests ON evaluations.test_id = tests.id | |
JOIN courses ON tests.course_id = courses.id | |
WHERE members.type = 'Student' | |
GROUP BY members.name, members.id, courses.id, courses.name; |
/* Create table member */ | |
/* A member can have types, ie: Student, Professor */ | |
CREATE TABLE members( | |
id bigserial PRIMARY KEY, | |
name character variying, | |
type character variying NOT NULL | |
); | |
/* Create courses */ | |
CREATE TABLE courses( |
# I think this needs a lot of refactor :( | |
# Extend the integer class | |
class Integer | |
# each group represents positions splitted by 6 | |
# for each group, we need to | |
# locate the period | |
# for each period, locate the two classes | |
# then add classes name (left to right) name | |
# add period | |
# add hundreds |
# Extend Integer class to add factorial related methods | |
class Integer | |
# Iterative factorial | |
def factorial | |
# fail if this is called by negative numbers | |
raise ArgumentError, 'Not valid for negative numbers' if self < 0 | |
return 1 if zero? | |
# iterates backwards and inject * to the acumulator | |
downto(1).inject(:*) |
source 'https://rubygems.org' | |
# Explicit ruby version | |
ruby "2.3.0" # OMG it's magic! | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.2.5' | |
# Continue... |