Skip to content

Instantly share code, notes, and snippets.

@Mike-Dunton
Mike-Dunton / vault-copy-unwrap.sh
Created July 6, 2018 21:43 — forked from aelindeman/vault-copy-unwrap.sh
vault with copy, move, and token-unwrap-to-path
#!/bin/bash
set -eo pipefail
export VAULT_BIN="$HOME/.local/bin/vault-0.10.3" # or wherever you've installed vault
oopsie() {
echo "usage: $*"
exit 1
}
@Mike-Dunton
Mike-Dunton / .profile
Created February 18, 2021 19:57
My GIF workflow
alias yt-dl='docker run \
--rm -i \
-e PGID=$(id -g) \
-e PUID=$(id -u) \
-v "$(pwd)":/workdir:rw \
mikenye/youtube-dl'
alias ffmpeg-dkr='docker run --rm \
--entrypoint ffmpeg \
-v $(pwd):/config \
-w="/config" \
@Mike-Dunton
Mike-Dunton / consul-tree-move.sh
Created May 29, 2019 00:48
Move a consul tree
#!/bin/bash
PATH_FROM="some/path/with/keys/"
PATH_TO="some/new/path/"
consul kv export ${PATH_FROM} > tempfile
sed -i .bak s~$PATH_FROM~$PATH_TO~ tempfile
consul kv import @tempfile
@Mike-Dunton
Mike-Dunton / luckyBallChecker.js
Last active May 15, 2017 20:46
Bookmarklet to check what you won in lucky money
// Runs on flalottery.com
// http://www.flalottery.com/site/winningNumberSearch?searchTypeIn=number&gameNameIn=LUCKYMONEY&n1In=2&n2In=3&n3In=4&n4In=5&lbIn=1&
//
// Add the Following Javascript bookmarklet to your bookmarks.
// Click the bookmark while you are on your winningNumbers Search results for your numbers.
// Check Console for output.
// Expected Output:
//
// Results for date range Fri Feb 03 2017 00:00:00 GMT-0500 (EST) : Tue May 16 2017 00:00:00 GMT-0400 (EDT)
// Winner: 05/05/2017 // 23 - 26 - 33 - 35 LB 1 // Free Ticket

Keybase proof

I hereby claim:

  • I am mike-dunton on github.
  • I am mdunton (https://keybase.io/mdunton) on keybase.
  • I have a public key ASCwVs8ywoHPi-L9-ef3HOT_rUfTq33JzmB7BrT8U3zCuQo

To claim this, I am signing this object:

@Mike-Dunton
Mike-Dunton / Collatz.js
Last active August 9, 2016 21:49
Collatz conjecture in js
// Return Collatz sequence in an array.
// Linear Vs Tail Recursion in Javascript
// http://jsperf.com/collatz-conjecture-linear-vs-tail
//===================================================================================================================
function collatzTail(n, accumulator){
if(n === 1) {
accumulator.push(1);
return accumulator;
} else if(isEven(n)) {
accumulator.push(n);
@Mike-Dunton
Mike-Dunton / promiseExample.js
Created August 3, 2016 00:59
Example using q promise.
var qPromise = require('q')
var buildSecretTeller = function(promiseArray) {
return function(data){
var deferred = qPromise.defer();
promiseArray.push(deferred.promise)
var secretWaitLength = 2; //in seconds
console.log("I will tell you the secret in " + secretWaitLength + " seconds");
setTimeout(function(){
console.log("All done waiting, I am going to resolve my promise now and tell you the secret");
@Mike-Dunton
Mike-Dunton / tryCatchTest.erl
Last active October 26, 2015 18:05
Exploring the try catch in erlang
-module(tryCatchTest).
-export([start/0]).
-export([start_two/0]).
start() ->
function_one().
start_two() ->
try function_one() of
ok ->