Skip to content

Instantly share code, notes, and snippets.

[alias]
gone = ! "git fetch -p && git for-each-ref --format '%(refname:short) %(upstream:track)' | awk '$2 == \"[gone]\" {print $1}' | xargs git branch -D"
class QueuedParallel
def self.run(array)
raise ArgumentError, "Must have array" unless array.is_a?(Array)
q = Queue.new
q.instance_variable_set(:@que, array)
(0..2).map do
Thread.new do
while !q.empty?
obj = q.pop
#Total number of users registered
#Change line 4 comparasion value to 1 = last day, 7 = last week, 30 = last month, etc.
select count(u.id) from users u
where DATEDIFF(NOW(), u.created_at) <= 30;
#Total number of users with phone verification blocks
#Change line 10 comparasion value to 1 = last day, 7 = last week, 30 = last month, etc.
select count(distinct u.id) from users u
join user_blocks ub on u.id = ub.user_id and ub.block_type_name = "phone_verification"
where DATEDIFF(NOW(), u.created_at) <= 30