Skip to content

Instantly share code, notes, and snippets.

set autochdir
set nobackup
set nowritebackup
set noswapfile
set list listchars=tab:→\ ,trail:·
set tabstop=4
set smartindent
set fo=tcrq
// Implements the signing example w/out AWS SDK in nodejs. See:
// http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html
const crypto = require('crypto');
function signingKey(secretAccessKey, region, service, datetime) {
var date = datetime.substr(0, 8);
var kDate = crypto.createHmac('sha256', 'AWS4' + secretAccessKey).update(date).digest();
var kRegion = crypto.createHmac('sha256', kDate).update(region).digest();
var kService = crypto.createHmac('sha256', kRegion).update(service).digest();
return crypto.createHmac('sha256', kService).update('aws4_request').digest('hex');
<!DOCTYPE html>
<html>
<head>
<title>Play Time</title>
</head>
<body>
<form>
<input type="file" id="file-chooser" />
<button id="upload-button">Upload to S3</button>
<div id="results"></div>
@brycefisher
brycefisher / restore-fo-api.sh
Created October 4, 2016 16:15
Mongorestore fulfillment options
#!/bin/bash
mongorestore --drop -d fulfillment_options_development $HOME/.goodeggs-data-dumps/fulfillment-options/
@brycefisher
brycefisher / math.py
Last active May 12, 2017 00:26
Estimate Costs for Burst Mode
#!/usr/bin/env python3
# TODO -- Debug this logic. It doesn't quite seem to give the expected results.
import csv
filename = 'pre-failover.csv'
HOUR = 60
max_wait = 1
TASKS_PER_INSTANCE = 6
@brycefisher
brycefisher / keybase.md
Created December 9, 2017 03:47
keybase.md

Keybase proof

I hereby claim:

  • I am brycefisher on github.
  • I am bff (https://keybase.io/bff) on keybase.
  • I have a public key ASBZB5Tjeib9trqDLSZppdt5o1m8d8wAylr_Jmdkl3fMJgo

To claim this, I am signing this object: