docker kill $(docker ps -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -q -f dangling=true)
{ | |
"Deutschland": [ | |
"Baden-Württemberg", | |
"Bayern", | |
"Berlin", | |
"Brandenburg", | |
"Bremen", | |
"Hamburg", | |
"Hessen", | |
"Mecklenburg-Vorpommern", |
def get_day_of_week(year, month, day): | |
month_table = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4] | |
if month < 3: | |
year = year - 1 | |
return (year + year / 4 - year / 100 + year / 400 + month_table[month - 1] + day) % 7 | |
print get_day_of_week(2016, 3, 25) |
def memoize(f): | |
cache = {} | |
def memoized_function(*args): | |
if args not in cache: | |
cache[args] = f(*args) | |
return cache[args] | |
memoized_function.cache = cache | |
return memoized_function |
from json import dumps | |
def dict_in_list(a_dict, a_list): | |
""" | |
check if a_list already contains a_dict | |
""" | |
def dict_equals_dict(dict_a, dict_b): | |
""" | |
check if all key-value-pairs of dict_a and dict_b are equal | |
""" |
<html> | |
<head> | |
<title>kitten store</title> | |
<style> | |
.img-container { | |
width: 600px; | |
height: 800px; | |
display: flex; | |
align-items: center; | |
justify-content: center; |
@media (min-width:320px) { | |
/* smartphones, iPhone, portrait 480x320 phones */ | |
body {background-color: red} | |
} | |
@media (min-width:481px) { | |
/* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ | |
body {background-color: orange} | |
} | |
@media (min-width:641px) { | |
/* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ |
#!/usr/bin/python | |
import xerox | |
import time | |
def poll_cb(): | |
cb = "" | |
cbh = "" | |
while True: |
media_types = { | |
"": "application/octet-stream", | |
".aif": "audio/aiff", | |
".aiff": "audio/aiff", | |
".au": "audio/basic", | |
".avi": "video/avi", | |
".bmp": "image/bmp", | |
".bz": "application/x-bzip", | |
".bz2": "application/x-bzip2", | |
".c": "text/x-c", |