Skip to content

Instantly share code, notes, and snippets.

@Mike-Dunton
Mike-Dunton / .profile
Created Feb 18, 2021
My GIF workflow
View .profile
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" \
View consul-tree-move.sh
#!/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 / vault-copy-unwrap.sh
Created Jul 6, 2018 — forked from aelindeman/vault-copy-unwrap.sh
vault with copy, move, and token-unwrap-to-path
View vault-copy-unwrap.sh
#!/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 / luckyBallChecker.js
Last active May 15, 2017
Bookmarklet to check what you won in lucky money
View luckyBallChecker.js
// 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
View keybase.md

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 / promiseExample.js
Created Aug 3, 2016
Example using q promise.
View promiseExample.js
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 Oct 26, 2015
Exploring the try catch in erlang
View tryCatchTest.erl
-module(tryCatchTest).
-export([start/0]).
-export([start_two/0]).
start() ->
function_one().
start_two() ->
try function_one() of
ok ->
@Mike-Dunton
Mike-Dunton / Collatz.js
Last active Aug 9, 2016
Collatz conjecture in js
View Collatz.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);