Skip to content

Instantly share code, notes, and snippets.

🖖
coffee

Damon Jablons blackrobot

🖖
coffee
Block or report user

Report or block blackrobot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@koop
koop / ensure-cert-macos.sh
Created Nov 28, 2017
Ensures a certificate is in the macOS system keychain.
View ensure-cert-macos.sh
#!/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.
View commit-message-guidelines.md

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
veuncent / docker_debugging.md
Last active Sep 21, 2019
Debugging Django apps running in Docker using ptvsd - Visual Studio (Code)
View docker_debugging.md

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
PurpleBooth / README-Template.md
Last active Sep 22, 2019
A template to make good README.md
View README-Template.md

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.

Prerequisites

@blueyed
blueyed / test_django_data_migration.py
Last active Mar 12, 2019
Test Django data migrations
View test_django_data_migration.py
"""
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
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.
]]
View useful_pandas_snippets.md

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)

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active Sep 2, 2019
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!
View whiteboardCleaner.md

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@KartikTalwar
KartikTalwar / Documentation.md
Last active Sep 13, 2019
Rsync over SSH - (40MB/s over 1GB NICs)
View Documentation.md

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
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Created Jun 23, 2012 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
View pedantically_commented_playbook.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
You can’t perform that action at this time.