Skip to content

Instantly share code, notes, and snippets.

@facundovictor
facundovictor / terraform-provider-aws-builder-Dockerfile
Created March 29, 2018 03:02
Dockerfile used for building the AWS terraform provider --> https://www.terraform.io/docs/providers/aws/
FROM centos:7.4.1708
RUN yum install -y -q which vim wget git zip unzip gzip cmake make
ENV GOPATH=/opt/golang
WORKDIR $GOPATH
# Go references:
# https://golang.org/doc/install
# https://golang.org/cmd/go/#hdr-GOPATH_environment_variable
@facundovictor
facundovictor / destructuring.js
Created December 12, 2018 22:57 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
#!/bin/bash
S3_BUCKET_NAME="${1?Missing 1st argument bucket Name}"
S3_KEY="${2?Missing 2nd argument bucket key}"
FILE_PATH="${3?Missing 3rd argument file path}"
formated_date=`date -R`
content_type="application/octet-stream"
curl -v -X PUT -T ${FILE_PATH} \
-H "Host: ${S3_BUCKET_NAME}.s3.amazonaws.com" \
-H "Date: ${formated_date}" \
-H "Content-Type: ${content_type}" \