Skip to content

Instantly share code, notes, and snippets.

View hakanson's full-sized avatar

Kevin Hakanson hakanson

View GitHub Profile
@hakanson
hakanson / temporary-credentials.mmd
Last active September 19, 2022 00:30
Amazon S3 objects using IAM Temporary Credentials
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hakanson
hakanson / aws-xray-utils.js
Last active December 28, 2018 03:35
adds an AWS X-Ray subsegment and Metadata for an Alexa Skills Kit triggered Lambda
'use strict';
// http://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html
/*
* expected usage:
let AWS = require('aws-sdk');
const AWSXRay = require('aws-xray-sdk-core');
const AWSXRayUtil = require('./aws-xray-utils');
if (process.env.AWS_XRAY_DAEMON_ADDRESS) {
@hakanson
hakanson / ThreatDragonModels-test.json
Created August 16, 2017 16:38
testing naming of public gist
{
"key" : "value"
}
@hakanson
hakanson / gist:8558839
Created January 22, 2014 13:38
Attempt to wrap the IE11 (msCrypto) implementation of the WebCryptoAPI (based on the spec before Promise) with a promise API inside an AngularJS based application using $q.
var qmsCrypto = {
subtle : {
importKey : function(format, keyData, algorithm, extractable, keyUsages) {
var deferred = $q.defer();
var op = window.msCrypto.subtle.importKey(format, keyData, algorithm, extractable, keyUsages);
op.onerror = function (evt) {
deferred.reject(evt.toString());
$scope.$apply();
};