Skip to content

Instantly share code, notes, and snippets.

sweet potato

Terra Mauthe terramauthe

sweet potato
View GitHub Profile
terramauthe /
Created Jul 10, 2019
Terraform module for iam policy docco to block non-VPC access
data "aws_iam_policy_document" "s3_bucket_policy" {
statement {
condition {
test = "StringNotEquals"
variable = "aws:sourceVpc"
values = [
terramauthe /
Created May 1, 2019
Using code-forensics to get insights on a codebase


This is a brief description of how to get insights on a codebase using code-forensics.

For more information - please see the repo here:


  • Node.js v11.x or greater installed
  • gulp installed (npm install -g gulp)
terramauthe /
Created Jan 30, 2017
Randomly find a number which satisfies Luhn's algorithm
#!/usr/bin/env python
import random
def digits_of(number):
return [int(i) for i in str(number)]
def luhn_checksum(card_number):
digits = digits_of(card_number)
odd_digits = digits[-1::-2]
even_digits = digits[-2::-2]
terramauthe /
Created Jan 30, 2017
Generates music from entropy
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(42*exp((a[$1 % 8]/6)*log(2))*i)) }' | xxd -r -p | sox -traw -r 44100 -e unsigned -b 32 -c 2 - -d
terramauthe /
Last active Jun 14, 2016
Generate Static HTML from a WP site
echo "START"
# Validate Output Dir
if [ -z "${OUTPUT_DIR}" ]; then
echo "OUTPUT_DIR is unset: [${OUTPUT_DIR}]"
exit 1
terramauthe /
Last active Apr 27, 2022
Fullscreen Widget for the Dashing dashboard from Shopify

Include in your dashboard like this:

<div data-id="fullscreen" data-view="Fullscreen"></div>

It doesn't even need to be part of the grid, Dashing will happily initialise it anywhere on your page. It is invisible.

Once added to your page, Hit 'f' to enter fullscreen.

terramauthe / Gemfile
Last active May 27, 2020
Simple Mechanize Scraper
View Gemfile
source ''
gem 'mechanize'
terramauthe /
Last active Dec 18, 2015
List all branches and date of latest commit for a repo. Great for coordinating restoration of distributed backups after git remote data loss.
git for-each-ref --shell --format='echo ${PWD##*/} - %(refname); git show --format="%ci %cr" %(refname) | head -n 1' refs/heads/ | bash
terramauthe / .bash_profile
Created Feb 27, 2013
Bash Alias - Ignore SSL for Git command
View .bash_profile
alias nossl="env GIT_SSL_NO_VERIFY=true"
terramauthe / fizzBuzz.js
Last active Dec 9, 2015
JS FizzBuzz, Generalized
View fizzBuzz.js
//Factory for Test Conditions
function testFactor(factor, msg) {
"use strict";
return function(i){
var output = "";
if(i%factor===0) {
output = msg;
return output;