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;
}
I hereby claim:
To claim this, I am signing this object:
from functools import partial | |
from io import BytesIO | |
from zipfile import ZipFile | |
import pandas as pd | |
import requests | |
zipurl = "https://eco2mix.rte-france.com/download/eco2mix/eCO2mix_RTE_energie_M.zip" | |
resp = requests.get(zipurl) | |
unzipped = ZipFile(BytesIO(resp.content)) | |
xls_data = unzipped.open('eCO2mix_RTE_energie_M.xls').read() |
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 postgres
Some 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)copy_abspath() { realpath $1 | tr -d '\n' | xclip -selection clipboard; } |
#!/usr/bin/env python3 | |
from subprocess import run | |
from time import sleep | |
def main(): | |
for i in range(200): | |
print ("try", i+1) | |
run(["ping -c 10 8.8.8.8"], shell=True) | |
sleep(4) |
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 { |