kill $(ps -e | grep hung_tasks | awk '{print $1}')
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
This file contains hidden or 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
| """ | |
| Push items onto the Stack so that we can compare them as we process our string. | |
| If the stack is not empty the element encapsulation is invalid. | |
| """ | |
| element = '[[{}]()]' | |
| stack = list() | |
| def matched_set(a, b): |
This file contains hidden or 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
| #!/bin/bash | |
| python -W error:"":RuntimeWarning:django.db.models.fields:0 manage.py runserver |
This file contains hidden or 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
| def get_coins(cents, coins): | |
| if cents < 1: | |
| return 0 | |
| num_coins = 0 | |
| for coin in coins: | |
| num_coins += int(cents / coin) | |
| cents = cents % coin | |
| if cents == 0: | |
| break | |
| return num_coins |
This file contains hidden or 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
| from functools import lru_cache | |
| @lru_cache(1000) | |
| def fibonacci(n): | |
| if n == 0: | |
| return 0 | |
| elif n == 1: | |
| return 1 | |
| return fibonacci(n - 1) + fibonacci(n - 2) |
I hereby claim:
- I am citadelgrad on github.
- I am citadelgrad (https://keybase.io/citadelgrad) on keybase.
- I have a public key ASBvQ9sOB-mYtz8g05XGM63UM0jDxKxhwPB2uy6OpRGykwo
To claim this, I am signing this object:
This file contains hidden or 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
| FROM python:2.7.11 | |
| RUN apt-get update && apt-get install -y libmemcached-dev | |
| COPY . /app | |
| WORKDIR /app | |
| RUN pip install -r requirements.txt |
This file contains hidden or 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
| version: "2" | |
| services: | |
| db: | |
| image: postgres | |
| volumes: | |
| - db_data:/var/lib/postgresql/data | |
| - ./backup:/backup | |
| ports: | |
| - "8001:5432" |
This file contains hidden or 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
| """ HTML | |
| <form action="." method="POST"> | |
| {% csrf_token %} | |
| {{ form.as_p }} | |
| {{ formset.as_p }} | |
| <input type="submit" value="Create/Update Template"> | |
| </form> | |
| """ | |
| """ views.py """ |