INSERT GRAPHIC HERE (include hyperlink in image)
Subtitle or Short Description Goes Here
| to create a new environment | |
| conda create -n mynewenviron package1 package2 etc | |
| conda create -n newenv --clone ~anaconda | |
| to remove an environment | |
| conda remove -n myenvirontoremove --all | |
| always start with |
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
| """ | |
| Single Responsibility Principle | |
| “…You had one job” — Loki to Skurge in Thor: Ragnarok | |
| A class should have only one job. | |
| If a class has more than one responsibility, it becomes coupled. | |
| A change to one responsibility results to modification of the other responsibility. | |
| """ | |
| class Animal: | |
| def __init__(self, name: str): |
| " plugins | |
| let need_to_install_plugins = 0 | |
| if empty(glob('~/.vim/autoload/plug.vim')) | |
| silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
| \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| let need_to_install_plugins = 1 | |
| endif | |
| call plug#begin() | |
| Plug 'tpope/vim-sensible' |
| import os | |
| import time | |
| import json | |
| import socket | |
| import logging | |
| from slacker import Slacker, Error as SlackerError | |
| class SlackChannelHandler(logging.Handler): |
This is a sample on how to stream the results of a large QuerySet into a CSV file using Django StreamingHttpResponse class.
CSVStream class in your project, for example a writers.py file:import csv
from django.http import StreamingHttpResponse| """ | |
| Django ORM Optimization Tips | |
| Caveats: | |
| * Only use optimizations that obfuscate the code if you need to. | |
| * Not all of these tips are hard and fast rules. | |
| * Use your judgement to determine what improvements are appropriate for your code. | |
| """ | |
| # --------------------------------------------------------------------------- |
| #!/bin/bash | |
| sudo apt-get install -y \ | |
| apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo apt-key fingerprint 0EBFCD88 | |
| sudo add-apt-repository \ | |
| "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |