Skip to content

Instantly share code, notes, and snippets.

Chase Stephens chastep

Block or report user

Report or block chastep

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sleep_func.js
const sleep = ms => new Promise(res => setTimeout(res, ms));
chastep / find_missing.rb
Created Oct 3, 2019
Hacker Rank Find Missing Numbers
View find_missing.rb
def missingNumbers(arr, brr)
og_hash = brr.inject( { |h,v| h[v] += 1; h }
missing_hash = arr.inject( { |h,v| h[v] += 1; h } { |k, v| missing_hash[k] < v || (v == 1 && !missing_hash[k]) }.keys.sort
chastep / gather_all_stripe_charges.rb
Created Sep 10, 2019
Collect more than 100 charges from Stripe::Charge.list
View gather_all_stripe_charges.rb
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 =

Keybase proof

I hereby claim:

  • I am chastep on github.
  • I am chastep ( on keybase.
  • I have a public key ASBtzwze7sysup3j2kbMtugEMYKNMfGc1ky2UiiehnjNHAo

To claim this, I am signing this object:

chastep /
Created Mar 14, 2018 — forked from staltz/
The introduction to Reactive Programming you've been missing
View controller sessions.rb
get '/sessions/new' do
if session[:user_id]
redirect "/"
erb :'/sessions/new'
post '/sessions/new' do
user = User.authenticate(params[:email], params[:password)
You can’t perform that action at this time.