Skip to content

Instantly share code, notes, and snippets.

View blackrobot's full-sized avatar
🖖
coffee

Damon Jablons blackrobot

🖖
coffee
View GitHub Profile
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"
@blackrobot
blackrobot / .bashrc
Created February 3, 2020 17:36
Simplified remote dotfiles
# 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'
@blueyed
blueyed / test_django_data_migration.py
Last active December 9, 2020 16:20
Test Django data migrations
"""
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):
@ruddra
ruddra / Docker with Django, Numpy, Scipy, Gensim and Pandas
Last active March 11, 2022 23:38
Docker with Django, Numpy, Scipy, Gensim and Pandas
# 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
@koop
koop / ensure-cert-macos.sh
Created November 28, 2017 20:27
Ensures a certificate is in the macOS system keychain.
#!/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.
@m1yag1
m1yag1 / migrate_zenhub_issues.py
Last active February 14, 2023 18:27
Migrate Issues from ZenHub to GH Projects
# 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
@veuncent
veuncent / docker_debugging.md
Last active February 21, 2024 00:58
Debugging Django apps running in Docker using ptvsd - Visual Studio (Code)

Remote debugging in Docker (for Django apps)

In order to enable debugging for your Django app running in a Docker container, follow these steps using Visual Studio (Code):

  1. Add ptvsd to your requirements.txt file
ptvsd == 4.3.2
  1. To your launch.json, add this:
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active March 31, 2024 18:45 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)