Skip to content

Instantly share code, notes, and snippets.

View stephen-bunn's full-sized avatar
💭
Stuck in ideation

Stephen Bunn stephen-bunn

💭
Stuck in ideation
View GitHub Profile
@stephen-bunn
stephen-bunn / chapt.sh
Last active October 10, 2021 01:34
Quick script I use for updating existing chapter names in video files
#!/usr/bin/env sh
DEPENDENCIES="ffprobe ffmpeg jq"
for dep_name in $DEPEDENCIES
do
if !(command -v "$dep_name" > /dev/null 2>&1); then
echo "$dep_name not found";
exit 1;
fi
done
@stephen-bunn
stephen-bunn / vimium.css
Last active October 12, 2021 21:21
Personal preferences for a Dracula-themed Vimium
/*
* Vimium v1.67 Dracula Theme.
* Stephen Bunn <stephen@bunn.io>
*/
:root {
/* Globals for color and font theming. */
--vimium-surface-color: #15171b;
--vimium-text-color: #f8f8f2;
--vimium-accent-color: #9580ff;
@stephen-bunn
stephen-bunn / alacritty.lua
Last active December 1, 2022 15:35
Hammerspoon + Alacritty
-- Hammerspoon Spaces Management Library
-- https://github.com/asmagill/hs._asm.spaces
local spaces = require('hs.spaces')
local ALACRITTY_NAME = 'Alacritty'
local ALACRITTY_SELECTOR = 'org.alacritty'
local ALACRITTY_TOGGLE_FULLSCREEN_KEYBIND = {'cmd', 'return'}
-- Configuration options for the Alacritty script
@stephen-bunn
stephen-bunn / keybase.md
Created October 1, 2019 15:04
keybase.md

Keybase proof

I hereby claim:

  • I am stephen-bunn on github.
  • I am stephenbunn (https://keybase.io/stephenbunn) on keybase.
  • I have a public key whose fingerprint is EED5 C84E B688 4E24 0067 A63D 8277 8750 2AF6 6606

To claim this, I am signing this object:

@stephen-bunn
stephen-bunn / foo.pyi
Created May 20, 2019 20:36
Medium - foo.py typing stub
# Stubs for foo (Python 3)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import List, Optional
def foo(input: List[int]) -> Optional[int]: ...
@stephen-bunn
stephen-bunn / setup.cfg
Created May 7, 2019 20:17
Medium - Example of Pytest configuration
[tool:pytest]
plugins = cov flake8 xdist
addopts = -rxsX --flake8 -n 4 --cov
norecursedirs = .git _build dist news tasks docs
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
flake8-ignore =
docs/source/* ALL
@stephen-bunn
stephen-bunn / __init__.py
Created May 7, 2019 20:08
Medium - Hypothesis Windows healthcheck profile
# Copyright (c) 2019 Stephen Bunn <stephen@bunn.io>
# ISC License <https://opensource.org/licenses/isc>
import sys
from hypothesis import settings, HealthCheck
settings.register_profile(
"windows", suppress_health_check=[HealthCheck.too_slow], deadline=None
)
@stephen-bunn
stephen-bunn / test_hypothesis.py
Last active May 7, 2019 17:24
Medium - Hypothesis example test for is_plaindrome
"""Basic pytest+hypothesis for ``is_palindrome`` method."""
from typing import Any, Callable
from hypothesis import given, assume
from hypothesis.strategies import text, composite
def is_palindrome(string: str) -> bool:
"""Determine if a given string is a palindrome.
@stephen-bunn
stephen-bunn / test_pytest.py
Created May 6, 2019 20:09
Medium - Pytest example tests for is_plaindrome
"""Basic pytest for ``is_palindrome`` method."""
from typing import List
import pytest
def is_palindrome(string: str) -> bool:
"""Determine if a given string is a palindrome.
@stephen-bunn
stephen-bunn / test_unittest.py
Created May 6, 2019 20:00
Medium - Basic unittest example for is_palindrome
"""Basic unittest for ``is_palindrome`` method."""
import unittest
def is_palindrome(string: str) -> bool:
"""Determine if a given string is a palindrome.
:param str string: The string to process
:return: True if given string is a palindrome, otherwise False