Skip to content

Instantly share code, notes, and snippets.


Damon Jablons blackrobot

View GitHub Profile
blackrobot / .bashrc
Created Feb 3, 2020
Simplified remote dotfiles
View .bashrc
# 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'
View chromaprint.rb
class Chromaprint < Formula
# Revert chromaprint changes to prevent ffmpeg circular dependency
desc "Core component of the AcoustID project (Audio fingerprinting)"
homepage ""
url ""
sha256 "ea18608b76fb88e0203b7d3e1833fb125ce9bb61efe22c6e169a50c52c457f82"
ruddra / Dockerfile
Created Oct 28, 2019
Docker with Django, Numpy, Scipy, Gensim and Pandas
View Dockerfile
# pull official python alpine image
FROM python:3.7-alpine
# Set Environment Variable
# Making source and static directory
RUN mkdir /src
RUN mkdir /static
koop /
Created Nov 28, 2017
Ensures a certificate is in the macOS system keychain.
# Usage
# $ ./ "/path/to/cert"
# 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 certs in the keychain.
# Don't return an error code if nothing is found.

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
veuncent /
Last active Nov 22, 2020
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:
PurpleBooth /
Last active Jan 15, 2021
A template to make good

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.


blueyed /
Last active Dec 9, 2020
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):
swo / cheaphints.lua
Created May 27, 2015
cheaphints: lightweight hints in hammerspoon
View cheaphints.lua
installation: put this file in ~/.hammerspoon and add this line to your init.lua:
local cheaphints = require "cheaphints"
usage: by default, just hit cmd+alt+E. you'll see a list of keys and associated
windows. if you hit escape, you'll exit hint mode. if you hit one of the keys in
the list, that window gets focused. the hint mode will exit automatically after
a while.

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)

You can’t perform that action at this time.