Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am victorbordo on github.
* I am vbordo (https://keybase.io/vbordo) on keybase.
* I have a public key ASBK4bzkl7-Q4sKvN3Cei0fna7qZMW6uRywZREME-nAcpQo
To claim this, I am signing this object:
@victorbordo
victorbordo / github_api_pagination.py
Last active January 17, 2024 07:42
Paginate through a Github API request with Python requests
import requests
import logging
logger = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
@victorbordo
victorbordo / token.rb
Created June 25, 2019 20:37 — forked from GregBaugues/token.rb
Google API OAuth 2.0 refresh token (Ruby on Rails)
# The OAuth access token provided by the Google API expires in 60 minutes. After expiration,
# you must exchange a refresh token for a new access token. Unfortunately, the the Google API
# ruby gem does not include a method for refreshing access tokens.
# You can read up on how to refresh an access token here:
# https://developers.google.com/accounts/docs/OAuth2WebServer#refresh
# This Token model implements that process. It's based off of a Token model that can be created
# by running:
# rails g model Token token:text refresh_token:string expires_at:datetime
@victorbordo
victorbordo / heroku_pg_db_reset.md
Created June 25, 2019 22:58 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate