Skip to content

Instantly share code, notes, and snippets.

View brunns's full-sized avatar

Simon Brunning brunns

View GitHub Profile
@brunns
brunns / extract_html_table_data.py
Last active February 6, 2024 14:58
Extract table data from HTML, save as CSV
#!/usr/bin/env scriptisto
# scriptisto-begin
# script_src: script.py
# build_once_cmd: python -m venv . && . ./bin/activate && pip install beautifulsoup4
# build_cmd: . ./bin/activate && chmod +x ./run.sh
# target_bin: ./run.sh
# files:
# - path: run.sh
# content: |
@brunns
brunns / gist:7b14040c1d8fc7d39302cb7e5ab14fac
Created January 30, 2024 10:58
Shell pipeline to turn any(?) text to file/directory name
iconv -s -t ascii//translit | tr -d \'\" | sed -E 's/[[:space:]]+/-/g' | tr A-Z a-z
# Install brew as per https://docs.brew.sh/Installation
# See https://bit.ly/3ykJEJC for tips
#
# Then run this .Brewfile like so:
#
# rm -rf $(brew --prefix)/var/homebrew/locks
# brew bundle install --global && brew cu -a -f
#
# Update with:
# rm -rf $(brew --prefix)/var/homebrew/locks
@brunns
brunns / pullall.sh
Created July 5, 2019 08:50
Pull all git repos under pwd
find . -type d -exec sh -c 'cd "{}"; git rev-parse --git-dir 2> /dev/null 1>&2' \; -prune -print | xargs -L1 -I% -t sh -c 'pushd % ; git pull -r ; popd'
[pull]
rebase = True
[user]
email = simon@brunningonline.net
name = Simon Brunning
[rerere]
enabled = true
[core]
editor = emacs
[alias]
@brunns
brunns / .ackrc
Last active June 15, 2018 13:18
default ack config
--ignore-directory=is:venv
--ignore-directory=is:.env
--ignore-directory=is:.direnv
--ignore-directory=is:.tox
--ignore-directory=is:.git
--ignore-directory=is:.terraform
--type-set=erb:ext:erb
--type-set=graphviz:ext:dot
--type-set=markdown:ext:md
--type-set=puppet:ext:pp,eyaml
@brunns
brunns / lazy_model.py
Created June 13, 2018 10:00
Lazily evaluated jinja2 model. Just a proof of concept, really, for now.
#!/usr/bin/env python3
import logging
import sys
import warnings
from collections import Mapping
from functools import lru_cache
from jinja2 import Template
from jinja2.utils import concat
@brunns
brunns / bunch.py
Created January 25, 2018 13:59
Bunch and friends
class EqualityFromDict:
"""Mix-in allowing equality checking from instance's __dict__"""
def __eq__(self, other):
return self.__class__ is other.__class__ and self.__dict__ == other.__dict__
class ReprFromDict:
"""Mix-in implementing repr() from instance's __dict__"""
@brunns
brunns / init.el
Last active November 13, 2018 13:20
My ~/.emacs.d/init.el
;; Packages
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(package-initialize)
(package-install 'auto-complete)
(package-install 'markdown-mode)
;; Theme
Verifying that +brunns is my blockchain ID. https://onename.com/brunns