Skip to content

Instantly share code, notes, and snippets.

View r4d1n's full-sized avatar

Jared Radin r4d1n

View GitHub Profile
const AWS = require('aws-sdk');
const cloudfront = new AWS.CloudFront({ apiVersion: '2017-03-25' });
const distributionId = process.env.distributionId;
exports.handler = (event, context, callback) => {
let promiseArr = event.Records.map(obj => {
return new Promise((resolve, reject) => {
let key = '/' + obj.s3.object.key;
let timestamp = String(new Date().getTime());
@r4d1n
r4d1n / iterators.md
Last active December 14, 2016 19:49
Rundown on ES6 iterators and generators

Iterators

A special kind of object. Always has a next method that returns an object with two attributes:

let foo = iterator.next() 

foo.done // true or false
foo.value // returned value
@r4d1n
r4d1n / encrypted-git-repo.md
Created November 21, 2016 16:54
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes