Skip to content

Instantly share code, notes, and snippets.

@snipe
snipe / fartgun.txt
Last active July 26, 2023 17:37
Pre-commit hook to prevent dummy text from being committed
#!/bin/sh
#
# This git hook should let us prevent commits from containing words that we sometimes use
# as "sky is blue" proof that a method is working when it's behaving strangely.
disallowed="poop fart poopy farty shit fuck"
git diff --cached --name-status | while read x file; do
if [ "$x" == 'D' ]; then continue; fi
for word in $disallowed
@rhowe-gds
rhowe-gds / generate-gpg-yubikey.sh
Last active April 30, 2019 17:41
Generate GPG keys and put them on a Yubikey
#!/bin/bash
set -euo pipefail
GNUPGHOME=$(mktemp -d)
cleanup() {
echo rm -rf "$GNUPGHOME"
killall gpg-agent || :
}
set __COMPAT_LAYER=RUNASINVOKER
start "Black Desert Online" "Black Desert Online Launcher.exe"
@samtx
samtx / config
Last active April 29, 2024 23:57
Pretty git log graphs
# add to ~/.gitconfig file
# By Slipp D. Thompson, at http://stackoverflow.com/questions/1838873/visualizing-branch-topology-in-git/34467298#34467298
[alias]
lg = !"git lg1"
lg1 = !"git lg1-specific --all"
lg2 = !"git lg2-specific --all"
lg3 = !"git lg3-specific --all"
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
@arinto
arinto / all-options.elasticsearch.yml
Last active September 26, 2018 18:12
`elasticsearch.yml` with all options
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options:
@tylerneylon
tylerneylon / json.lua
Last active May 15, 2024 12:57
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
##################### ElasticSearch Configuration Example #####################
# This file contains an overview of various configuration settings,
# targeted at operations staff. Application developers should
# consult the guide at <http://elasticsearch.org/guide>.
#
# The installation procedure is covered at
# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>.
#
# ElasticSearch comes with reasonable defaults for most settings,