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
[project] | |
name = "New-Project" | |
description = "Replace this with a description" | |
version = "0.0.1" | |
authors = [{name = "Ben Gosney", email = "bengosney@googlemail.com"}] | |
dependencies = [] | |
[project.optional-dependencies] | |
dev = ["black", "mypy", "pip-tools", "pre-commit", "icecream"] |
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 | |
for PY in $(ls /usr/bin/python3.* | egrep "3.[0-9]+$"); do | |
PRI=$(echo $PY | egrep -o "[0-9]+$") | |
echo "Installing 3.$PRI" | |
update-alternatives --install /usr/bin/python python ${PY} ${PRI} | |
update-alternatives --install /usr/bin/python3 python3 ${PY} ${PRI} | |
done |
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
[Unit] | |
Description=MailHog service | |
After=docker.service | |
Wants=network-online.target docker.socket | |
Requires=docker.socket | |
[Service] | |
TimeoutStartSec=120 | |
Restart=on-failure | |
RestartSec=5 |
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
exclude: migrations/.*\.py|Procfile|[aw]sgi\.py|node_modules|.git|\.polar|inputs/.* | |
repos: | |
- repo: https://github.com/pre-commit/pre-commit-hooks | |
rev: v4.4.0 | |
hooks: | |
- id: trailing-whitespace | |
- id: end-of-file-fixer | |
- id: check-yaml | |
- id: check-json | |
- id: check-toml |
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
$size: 15px; | |
$background: white; | |
background-image: | |
linear-gradient(to right, $background, $background), | |
linear-gradient(to right, $background, $background), | |
radial-gradient(ellipse closest-side, rgba(0,0,0,.25) 0%,rgba(0,0,0,0) 100%), | |
radial-gradient(ellipse closest-side, rgba(0,0,0,.25) 0%,rgba(0,0,0,0) 100%); | |
background-position: left center, right center, -($size / 2) center, right (-($size / 2)) center; | |
background-repeat: no-repeat; | |
background-color: $background; |
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
.PHONY: help clean test install all init dev | |
.DEFAULT_GOAL := install | |
.PRECIOUS: requirements.%.in | |
HOOKS=$(.git/hooks/pre-commit) | |
REQS=$(wildcard requirements.*.txt) | |
PYTHON_VERSION:=$(shell python --version | cut -d " " -f 2) | |
PIP_PATH:=.direnv/python-$(PYTHON_VERSION)/bin/pip | |
WHEEL_PATH:=.direnv/python-$(PYTHON_VERSION)/bin/wheel |
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
.PHONY := serv, cleancd | |
.DEFAULT_GOAL := serv | |
SCRIPTFILE=simple-https-server.py | |
CERT=server.pem | |
IP=$(shell hostname -I | cut -f 1 -d " ") | |
DIR=$(shell pwd) | |
$(SCRIPTFILE): | |
@echo "" > $@ |
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 | |
ASPELL=$(which aspell) | |
if [ $? -ne 0 ]; then | |
echo "Aspell not installed - unable to check spelling" >&2 | |
exit | |
else | |
WORDS=$($ASPELL --mode=email --add-email-quote='#' list < "$1" | sort -u) | |
fi | |
if [ -n "$WORDS" ]; then | |
printf "\e[1;33m Possible spelling errors found in commit message:\n\e[0m\e[0;31m%s\n\e[0m\e[1;33m Use git commit --amend to change the message.\e[0m\n\n" "$WORDS" >&2 |
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
// Copyright 2018 Ben Gosney - MIT licence - https://opensource.org/licenses/MIT | |
const fs = require('fs'); | |
const mkdirp = (full_path) => { | |
while (!fs.existsSync(full_path)) { // loop untill the full path excists | |
let part_path = full_path; | |
while(!fs.existsSync(part_path)) { // this will be true after we find a dir we can make then loop and start again | |
try { |
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
import re | |
class EmailParamType(click.ParamType): | |
name = 'email' | |
email_re = re.compile(r"[^@]+@[^@]+\.[^@]+") | |
def convert(self, value, param, ctx): | |
if self.email_re.match(value): | |
return value | |
else: |
NewerOlder