I hereby claim:
- I am chastep on github.
- I am chastep (https://keybase.io/chastep) on keybase.
- I have a public key ASBtzwze7sysup3j2kbMtugEMYKNMfGc1ky2UiiehnjNHAo
To claim this, I am signing this object:
const sleep = ms => new Promise(res => setTimeout(res, ms)); |
# https://www.hackerrank.com/challenges/missing-numbers/problem | |
def missingNumbers(arr, brr) | |
og_hash = brr.inject(Hash.new(0)) { |h,v| h[v] += 1; h } | |
missing_hash = arr.inject(Hash.new(0)) { |h,v| h[v] += 1; h } | |
og_hash.select { |k, v| missing_hash[k] < v || (v == 1 && !missing_hash[k]) }.keys.sort | |
end |
def gather_all_stripe_charges | |
all_charges = [] | |
has_more = true | |
last_charge_id = nil | |
while has_more | |
charges = Stripe::Charge.list({ limit: 100, starting_after: last_charge_id}) | |
all_charges += initial_charges['data'].map { |charge| {id: charge['id'], amount: charge['amount']} } | |
has_more = false unless charges['has_more'] | |
last_charge_id = all_charges.last.id |
I hereby claim:
To claim this, I am signing this object:
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
get '/sessions/new' do | |
if session[:user_id] | |
redirect "/" | |
else | |
erb :'/sessions/new' | |
end | |
end | |
post '/sessions/new' do | |
user = User.authenticate(params[:email], params[:password) |