Skip to content

Instantly share code, notes, and snippets.

@kosyfrances
kosyfrances / coverage.md
Last active January 7, 2016 08:54
To combine multiple coverage reports in coverage.py
@kosyfrances
kosyfrances / python_test.md
Last active January 7, 2016 09:01
To run all tests in files in a folder in python
@kosyfrances
kosyfrances / heroku_database_copy.md
Last active July 18, 2024 17:39
To copy heroku database from one app to another and from local to heroku

To copy database from one heroku app to another -

heroku pg:backups capture [database_name]
heroku pg:backups restore $(heroku pg:backups public-url --app source_app) DATABASE_URL --app target_app

You can refer to https://devcenter.heroku.com/articles/heroku-postgres-backups for more information.

To copy database from local to heroku - Dump your local database in compressed format using the open source pg_dump tool: PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump where myuser is your database username and mydb is the database name.

@kosyfrances
kosyfrances / multiple_env_heroku.txt
Created December 7, 2015 22:05
Managing multiple environments for an app in heroku
Follow the instructions here -
https://devcenter.heroku.com/articles/multiple-environments#starting-from-an-existing-app
@kosyfrances
kosyfrances / deploy_python_bot.md
Last active January 7, 2016 09:03
Deploying a pure python slack-bot on heroku

This is not explanatory, and I have plans to explain better in my up-coming blog. It was difficult for me to find comprehensive information for pure python apps when I wanted to deploy my bot to heroku

Follow this process: https://devcenter.heroku.com/articles/getting-started-with-python Scale the worker process with heroku ps:scale worker=1 to keep the bot process running

@kosyfrances
kosyfrances / 0_reuse_code.js
Last active August 29, 2015 14:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console