In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):
- Add
ptvsd
to your requirements.txt file
ptvsd == 4.3.2
- To your
launch.json
, add this:
class Chromaprint < Formula | |
# Revert chromaprint changes to prevent ffmpeg circular dependency | |
# https://github.com/Homebrew/homebrew-core/pull/46684 | |
# https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/13 | |
desc "Core component of the AcoustID project (Audio fingerprinting)" | |
homepage "https://acoustid.org/chromaprint" | |
url "https://github.com/acoustid/chromaprint/releases/download/v1.4.3/chromaprint-1.4.3.tar.gz" | |
sha256 "ea18608b76fb88e0203b7d3e1833fb125ce9bb61efe22c6e169a50c52c457f82" |
# shellcheck shell=bash disable=SC2164,SC1117 | |
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# Note: PS1 and umask are already set in /etc/profile. You should not | |
# need this unless you want different defaults for root. | |
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ ' | |
# umask 022 | |
export TERM='xterm-256color' |
""" | |
Test (data) migrations in Django. | |
This uses py.test/pytest-django (the `transactional_db` fixture comes from there), | |
but could be easily adopted for Django's testrunner: | |
from django.test.testcases import TransactionTestCase | |
class FooTestcase(TransactionTestCase): | |
def test_with_django(self): |
# pull official python alpine image | |
FROM python:3.7-alpine | |
# Set Environment Variable | |
ENV PYTHONUNBUFFERED 1 | |
ENV C_FORCE_ROOT true | |
# Making source and static directory | |
RUN mkdir /src | |
RUN mkdir /static |
#!/bin/bash | |
# Usage | |
# $ ./install-cert-macos.sh "/path/to/cert" | |
CERT_PATH="$1" | |
# First, grab the SHA-1 from the provided SSL cert. | |
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g") | |
# Next, grab the SHA-1s of any standard.dev certs in the keychain. | |
# Don't return an error code if nothing is found. |
# We first create a spreadsheet with the ZenHub Pipeline and GitHub Project Column mapping | |
# Then, we moved all the issues manually into an "Unsorted" column in our GitHub Project | |
# Read through each of the issues that is in the Unsorted column and move them to the correct column | |
# if it's in the spreadsheet. | |
# To run: | |
# pip install python-dotenv ghzh-clients | |
import csv | |
import os |
This playbook has been removed as it is now very outdated. |
rsync (Everyone seems to like -z, but it is much slower for me)
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)