Skip to content

Instantly share code, notes, and snippets.

View chrisdev's full-sized avatar

Christopher Clarke chrisdev

View GitHub Profile
@chrisdev
chrisdev / postgres-cheatsheet.md
Created February 3, 2018 20:54 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
  • Update CHANGES.rst
  • Update version number in my_project/__init__.py
  • Update version number in setup.py
  • Install the package again for local development, but with the new version number:
python setup.py develop
  • Run the tests:
python setup.py test
@chrisdev
chrisdev / index.html
Last active August 29, 2015 14:03 — forked from anonymous/bGszx.markdown
Improving the UX of the submit button
UX improvement for Submitt Button
-----------------------------------
Forked from [Mark Hayes](http://codepen.io/mhayes)'s Pen [qdCAc](http://codepen.io/mhayes/pen/qdCAc/).
A [Pen](http://codepen.io/rafibomb/pen/bGszx) by [Rafi Benkual](http://codepen.io/rafibomb) on [CodePen](http://codepen.io/).
[License](http://codepen.io/rafibomb/pen/bGszx/license).
from django.db import models
class M1(models.Model):
title = models.CharField(max_length=100)
img1 = models.ImageField(upload_to="static/")
def __unicode__(self):
return self.title