Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
jaytaylor / install-go.sh
Created Feb 18, 2021
Golang Linux installer configurator
View install-go.sh
#!/usr/bin/env bash
##
# @description Golang Linux installer.
#
# Example usage:
#
# sudo -E ./install-go.sh
#
# @date 2021-02-18
@jaytaylor
jaytaylor / RichSQL.scala
Created Mar 12, 2020
Jay's RichSQL.scala from 2012
View RichSQL.scala
/*
* RichSQL.scala
*
* @note I originally found this at
* http://scala.sygneca.com/code/simplifying-jdbc. Since sourcing it I have
* made some improvements.
* -Jay T.
*/
import java.sql.ResultSet
@jaytaylor
jaytaylor / golang_linux_quick_install.md
Last active Mar 8, 2020
Golang Linux quick installer
View golang_linux_quick_install.md
cat > /tmp/install-go.sh << 'EOF'
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset

if [ "${1:-}" = '-v' ]; then
    echo 'INFO: Verbose debug output enabled' 1>&2
@jaytaylor
jaytaylor / ._python_programming_snippets.md
Last active Dec 21, 2020
Jay's Python programming skeleton snippets quick reference
View ._python_programming_snippets.md

Python programming skeleton snippets

Quick references to common and useful python best-practices programming snippets and boilerplate.

@jaytaylor
jaytaylor / multiline-mutator-v1.awk
Last active Jan 15, 2020
Multi-line search and inject new variable into helm templates.
View multiline-mutator-v1.awk
#
# Multi-line search and inject new variable into helm templates.
#
# n.b. Works somewhat dynamically.
#
BEGIN {
insertion = "{{- include \"bots.k8s-envvars\" . | indent 8 }}"
expr_seq[0] = " +envFrom: *$"
expr_seq[1] = "^{prefix1}( )?- configMapRef: *$"
@jaytaylor
jaytaylor / ubuntu-18.04-web-server-init.sh
Created Nov 3, 2019
Common Ubuntu server setup for LAMP-ish configuration.
View ubuntu-18.04-web-server-init.sh
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
if [ "$1" = '-v' ] ; then
set -o xtrace
shift
fi
@jaytaylor
jaytaylor / java-format-cleanup.sh
Created Oct 8, 2019
Perl-based Java codebase aesthetics format scrubber.
View java-format-cleanup.sh
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
for f in $(find . -name '*.java'); do
perl \
-0 \
-i \
@jaytaylor
jaytaylor / math.sh
Created Aug 8, 2019
Math functions from python as bash "builtins".
View math.sh
#!/usr/bin/env bash
##
#
# @author Jay E. Taylor <jay@jaytaylor.com>
#
# @description Math functions for bash!
#
##
@jaytaylor
jaytaylor / ._bash_shell_programming_snippets.md
Last active Feb 20, 2021
jaytaylor's Bash shell skeleton programming snippets quick reference
View ._bash_shell_programming_snippets.md

Bash shell skeleton programming snippets

Quick references to common and useful bash programming snippets and boilerplate.

@jaytaylor
jaytaylor / ._base64-url-shortener-poc.md
Last active Jan 24, 2021
URL shortener Base-62 encoder / decoder C++ Proof-of-Concept
View ._base64-url-shortener-poc.md