Skip to content

Instantly share code, notes, and snippets.

View zaneb's full-sized avatar

Zane Bitter zaneb

  • Red Hat
  • 13:34 (UTC +12:00)
View GitHub Profile
const iso8601RegEx = /([0-9]{4})-([0-1][0-9])-([0-3][0-9])T([0-2][0-9]):([0-5][0-9])Z/
function format2Digits(num) {
let asStr = '0' + num.toString()
return asStr.slice(-2)
}
function EntryTimestamp(node) {
this.node = node
this.date = function() {
@zaneb
zaneb / fast8.sh
Created June 20, 2019 17:12
Run flake8 against only files that have changed
#!/bin/bash
set -e
enable_env() {
local env_name="$1"
local env_dir=".tox/${env_name}"
if [ ! -d "${env_dir}" ]; then
if [ ! -f tox.ini ]; then
echo 'No tox.ini found' >&2