Skip to content

Instantly share code, notes, and snippets.

View smiller171's full-sized avatar

Scott Miller smiller171

View GitHub Profile
@smiller171
smiller171 / main.go
Last active March 10, 2016 21:33
mongodump to s3
package main
import (
"fmt"
"io"
"log"
"os/exec"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
@smiller171
smiller171 / godeps-full.sh
Last active June 12, 2017 17:27
List all go dependencies that are not in the standard library
go list -f '{{join .Deps "\n"}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
@smiller171
smiller171 / private.xml
Last active August 8, 2016 17:04
Karabiner code keyboard media keys with native fn on application key
<?xml version="1.1"?>
<root>
<item>
<name>Code Keyboard media keys</name>
<appendix>This will bind CODE/WASD the printed values on the media keys to their actual software function.
* FN+Insert : Pause / Play
* FN+Delete : Previous Song
* FN+End : Next Song
* FN+Pause : Mute Volume
* FN+Page Up : Volume Up
@smiller171
smiller171 / keybase.md
Created August 16, 2016 16:27
My publicly-auditable identity

Keybase proof

I hereby claim:

  • I am smiller171 on github.
  • I am smiller171 (https://keybase.io/smiller171) on keybase.
  • I have a public key whose fingerprint is A4B0 55D0 4E7D 2704 E673 0CCB 8659 EE68 4CAD 0E9F

To claim this, I am signing this object:

@smiller171
smiller171 / leastCommonMultiple.js
Last active December 11, 2016 16:59
find least common multiple of all numbers in a range.
function smallestCommons(arr) {
arr.sort(function(a,b) {
return b-a;
});
var min = arr[1];
var max = arr[0];
var allPrimeFactors = [];
var availablePrimes = [];
var reducedFactors = [];
var poweredFactors = [];
@smiller171
smiller171 / index.html
Last active March 7, 2017 05:45
Under Construction
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
</head>
@smiller171
smiller171 / pre-commit.bash
Created March 18, 2018 19:42
Dockerhub fork commit hook
#!/bin/bash
list=$(curl -s https://hub.docker.com/v2/repositories/library/node/tags/?page_size=500 | jq -r '.results|.[]|.name' | grep -v onbuild | grep -v latest |
sort)
branch=$(git rev-parse --abbrev-ref HEAD)
create_branch() {
tag=$1
branch=$2
if git rev-parse --verify ${tag} > /dev/null
then
echo "branch ${tag} exists"
2018-11-27 14:46:24 [000000] tea for god
2018-11-27 14:46:24 [000000] by void room (2016-2018)
2018-11-27 14:46:24 [000000] build: v0.3.0 (#166) built on: Nov 24 2018, 22:50:32
2018-11-27 14:46:24 [000000] load code info
2018-11-27 14:46:24 [000000] loading settings...
2018-11-27 14:46:24 [000000] initialising VR...
2018-11-27 14:46:24 [000000] choose oculus
2018-11-27 14:46:24 [000000] initialising oculus
2018-11-27 14:46:24 [000000] create device
2018-11-27 14:46:24 [000000] device : Oculus Rift CV1
@smiller171
smiller171 / database.tf
Last active October 3, 2023 16:49
Manage RDS password in Terraform in a sane way
resource "random_password" "db_master_pass" {
length = 40
special = true
min_special = 5
override_special = "!#$%^&*()-_=+[]{}<>:?"
keepers = {
pass_version = 1
}
}