Skip to content

Instantly share code, notes, and snippets.

Avatar
🍠
sweet potato

Tyler Mauthe tylermauthe

🍠
sweet potato
View GitHub Profile
@tylermauthe
tylermauthe / main.tf
Created Jul 10, 2019
Terraform module for iam policy docco to block non-VPC access
View main.tf
data "aws_iam_policy_document" "s3_bucket_policy" {
statement {
condition {
test = "StringNotEquals"
variable = "aws:sourceVpc"
values = [
"${var.vpc_id}",
]
}
@tylermauthe
tylermauthe / README.md
Created May 1, 2019
Using code-forensics to get insights on a codebase
View README.md

Intro

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

For more information - please see the repo here: https://github.com/smontanari/code-forensics

Dependencies

  • Node.js v11.x or greater installed
  • gulp installed (npm install -g gulp)
@tylermauthe
tylermauthe / random.py
Created Jan 30, 2017
Randomly find a number which satisfies Luhn's algorithm
View random.py
#!/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]
@tylermauthe
tylermauthe / random.sh
Created Jan 30, 2017
Generates music from entropy
View random.sh
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
@tylermauthe
tylermauthe / build.sh
Last active Jun 14, 2016
Generate Static HTML from a WP site
View build.sh
#!/bin/bash
echo "START"
OUTPUT_DIR="$1"
# Validate Output Dir
if [ -z "${OUTPUT_DIR}" ]; then
echo "OUTPUT_DIR is unset: [${OUTPUT_DIR}]"
exit 1
fi
@tylermauthe
tylermauthe / README.md
Last active Dec 1, 2020
Fullscreen Widget for the Dashing dashboard from Shopify
View README.md

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.

@tylermauthe
tylermauthe / Gemfile
Last active May 27, 2020
Simple Mechanize Scraper
View Gemfile
source 'https://rubygems.org'
gem 'mechanize'
@tylermauthe
tylermauthe / last-git-branch-update.sh
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.
View last-git-branch-update.sh
git for-each-ref --shell --format='echo ${PWD##*/} - %(refname); git show --format="%ci %cr" %(refname) | head -n 1' refs/heads/ | bash
@tylermauthe
tylermauthe / .bash_profile
Created Feb 27, 2013
Bash Alias - Ignore SSL for Git command
View .bash_profile
alias nossl="env GIT_SSL_NO_VERIFY=true"
@tylermauthe
tylermauthe / 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;
};
You can’t perform that action at this time.