Skip to content

Instantly share code, notes, and snippets.

@rouge8
rouge8 / git-status-prompt.sh
Created December 30, 2020 19:40
git status prompt in zig vs bash
#!/bin/bash
# Format 'git status' output for use in my prompt
set -eu
untracked=""
modified=""
for line in $(command git status --porcelain=v1 2> /dev/null | command cut -c-2); do
if [[ $line == ?? ]]; then
@rouge8
rouge8 / conf.py
Created July 13, 2017 04:42
sphinx-build -W treats non-sphinx warnings as errors
# -*- coding: utf-8 -*-
#
# Foo documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 12 21:34:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
@rouge8
rouge8 / links.rst
Created October 12, 2016 00:51
how to do links in rst
@rouge8
rouge8 / .coveragerc
Last active November 13, 2018 04:28
pytest, coverage.py, multi-line set/dict/generator comprehensinos
[run]
source = test_foo
branch = True
[report]
show_missing = True
@rouge8
rouge8 / .gitignore
Last active July 29, 2016 18:03
flake8 PicklingError
*.pex
.tox
import pytest
@pytest.mark.parametrize('val', [
b'\xac\x10\x02G',
b'\xfe\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xad\xbe\xef',
b'\x7f\x00\x00\x01',
])
def test_fail(val):
assert False
@rouge8
rouge8 / check-deps
Last active August 29, 2015 14:13
Check that a requirements.txt file is fully satisfied (including its dependencies) by the current environment. Useful for verifying installs done with `pip install --no-deps`
#!/usr/bin/env python
from argparse import ArgumentParser
import pkg_resources
def main():
parser = ArgumentParser('Check that a requirements.txt file is satisifed '
'by the current environment.')
parser.add_argument('filename')

Keybase proof

I hereby claim:

  • I am rouge8 on github.
  • I am rouge8 (https://keybase.io/rouge8) on keybase.
  • I have a public key whose fingerprint is 8615 0BD5 3032 4028 AAD0 86A1 D112 A173 40AD 85F8

To claim this, I am signing this object:

@rouge8
rouge8 / benchmark.sh
Last active August 29, 2015 14:01
pypy performance regression with fastavro https://bugs.pypy.org/issue1770
#!/bin/bash
set -eu
VENV_DIR=/tmp/fastavro-venv
function cleanup() {
rm -rf "$VENV_DIR"
}
function benchmark() {
@rouge8
rouge8 / .gitignore
Last active August 29, 2015 13:57
Makefile path weirdness
node_modules