Skip to content

Instantly share code, notes, and snippets.

View marcinbiegun's full-sized avatar
💭
🤔

Marcin Biegun marcinbiegun

💭
🤔
View GitHub Profile
@marcinbiegun
marcinbiegun / payola_migration_from_stripe.rb
Last active June 25, 2018 08:57 — forked from jayztemplier/payola_subscriptions.rb
Migration script for pulling all Stripe subscription to Payola database scheme
# Specific to your application
def find_local_user(stripe_customer)
User.find_by_stripe_key(stripe_customer.id) || User.find_by_email(stripe_customer.email)
end
def each_stripe_customer
starting_after = nil
while true
customers = Stripe::Customer.all(limit: 100, starting_after: starting_after)
break if customers.data.length == 0
@marcinbiegun
marcinbiegun / enable_lolcommits.rb
Last active June 4, 2018 11:42
Enable lolcommits in all directories in current shell location
dirs = `ls`.split("\n").map(&:chomp)
dirs.each do |dir|
puts "\n\n#{dir}\n\n"
puts `cd #{dir}; lolcommits --enable; cd ..`
end