This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button:focus {outline:0 !important;} | |
/* http://stackoverflow.com/questions/20340138/remove-blue-border-from-css-custom-styled-button-in-chrome */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source venv/bin/activate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heroku pg:psql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\? #List all \commands that can be used in psql. | |
\l #List all databases. | |
\d #List all tables in current database. | |
\d[table] #Show schema for table with name 'table'. | |
\du #List all users (roles) for this table. | |
\c[db] #Change to database with name 'db'. | |
\h #List SQL commands(e.g.SELECT,UPDATE...) | |
\q #Quit psql; you can also use Cmd/Ctrl+d | |
\d+ [tablename] # PostgreSQL “DESCRIBE TABLE” | |
SELECT current_database(); # show current database name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dropdb socialnetwork | |
createdb socialnetwork | |
createuser webapps | |
psql socialnetwork | |
GRANT ALL PRIVILEGES ON DATABASE socialnetwork TO webapps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you using MAC OS, you can stop port. | |
Find PID: lsof -i :1099 | |
Kill port: kill -9 PID_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Post.objects.all().delete() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caffeinate | |
http://www.maclife.com/article/columns/terminal_101_prevent_your_mac_sleeping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python manage.py shell | |
from socialnetwork.models import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import pdb; pdb.set_trace() | |
n: next |