JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# A little Ruby script to download your Drip broadcast messages to Jekyll-ready | |
# Markdown files. These could be used as posts or, better yet, as a collection. | |
# Inspired by Jonathan Stark's Drain https://github.com/jonathanstark/drain/ | |
# | |
# Copyright Ben Lopatin, 2018 | |
# Shared with an MIT license: https://opensource.org/licenses/MIT | |
# Since this is a standalone script, installing the dependencies is your responsibility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Clean all but specified packages of old homebrewed installed packages | |
declare -a exclude=(python python3 python34 python35 python36 python27 pypy ruby node) | |
for PACKAGE in $(brew ls) | |
do | |
SENTINEL=false | |
for EXCLUDE in "${exclude[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://gist.github.com/blueyed/4fb0a807104551f103e6 | |
from django.db import connection | |
from django.db.migrations.executor import MigrationExecutor | |
import pytest | |
@pytest.fixture() | |
def migration(transactional_db): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeTestMixin: | |
def assertCloseEnough(self, first, second, diff=0.0001): | |
""" | |
Asserts that the percentage difference between the two values | |
is smaller than given diff value. | |
Results may depend on the order of the values. A more robust | |
version might test the difference against both values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A short helper script to decode QuickTime .mov files to mp4 files using default settings. | |
# | |
# Usage: | |
# ./trim-movie.sh path/to/source.mov path/to/destination.mp4 | |
# ./trim-movie.sh path/to/source.mov path/to/destination.mp4 1080 | |
# | |
# The optional third paramater is width. You may need to respecify this if you encounter | |
# divisibility by 2 errors. Not sufficiently motivated to bother checking the size and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Script for exporting GitHub Issues to an import ready CSV format. | |
Outputs to stdout for redirection. | |
It is hard coded (sorry) to include up to 2 comments from an issue. | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Copyright 2016, Ben Lopatin | |
# Licensed freely to use, modify, and redistribute under GNUGPLv3 | |
APIKEY=$LEANPUB_API_KEY | |
SLUG=$LEANPUB_SLUG | |
case "$1" in | |
preview) |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)