When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}| # Encode inputfile.tar.gz as a series of video frames | |
| # Frames are written to frames/frameNNNN.png | |
| from PIL import Image | |
| with open('inputfile.tar.gz', 'rb') as f: | |
| data = f.read() | |
| WIDTH = 120 | |
| HEIGHT = 90 | |
| CHUNK_SIZE = int((WIDTH * HEIGHT) / 8) |
| from IPython.display import HTML | |
| from IPython.display import display | |
| # Taken from https://stackoverflow.com/questions/31517194/how-to-hide-one-specific-cell-input-or-output-in-ipython-notebook | |
| tag = HTML('''<script> | |
| code_show=true; | |
| function code_toggle() { | |
| if (code_show){ | |
| $('div.cell.code_cell.rendered.selected div.input').hide(); | |
| } else { |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-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)