Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

David Vuong davidvuong

🎯
Focusing
View GitHub Profile
View ExampleLogicalComponentTfTree.txt
terraform/
├── backend.tf
└── components
├── component_a
│ ├── exports.tf
│ └── main.tf
├── component_b
│ ├── exports.tf
│ └── main.tf
└── shared
View ExampleAWSS3Backend.tf
# backend.tf
bucket = "studio.voltron.project.tfstate"
region = "ap-southeast-2"
key = "terraform.tf"
dynamodb_table = "terraform-state-locks"
profile = "voltronstudio-master"
# Backends must be baked in during the initialization step:
#
# terraform init --backend-config=backend.tf
View ExampleTerraformRemoteState.tf
data "terraform_remote_state" "vpc" {
backend = "s3"
config {
bucket = "networking-terraform-state-files"
key = "vpc-prod.terraform.tfstate"
region = "us-east-1"
}
}
data.terraform_remote_state.vpc.private_subnet_ids
View ExampleSSMExports.tf
resource "aws_ssm_parameter" "sqs_http_proxy_id" {
name = "/voltron/shared/sqs/http-proxy/id"
type = "String"
value = module.sqs_http_proxy.id
overwrite = true
}
data "aws_ssm_parameter" "sqs_http_proxy_queue_url" {
name = "/voltron/shared/sqs/http-proxy/id"
}
View ExampleS3BucketWTfState.tf
terraform {
required_version = ">= 0.13"
}
provider "aws" {
version = "~> 3.0"
region = "ap-southeast-2"
}
resource "aws_s3_bucket" "b" {
@davidvuong
davidvuong / TakeHomeTest.md
Last active Jul 4, 2018
Tamagotchi Take-home test
View TakeHomeTest.md

Bring back the 90's.

You're lonely and bored. Your doritos are stale and no one is online, this loneliness you feel has a cure...A TAMAGOTCHI!

For those of you who have never heard of a Tamagotchi, here's a quick summary:

A tamagotchi is a virtual pet whose life you must sustain through various activities including eating, playing, making it sleep etc. Tamagotchi's go through several life cycles, most notably, egg/infant, teen, adult, elderly. Tamagotchi's can die from lack of attention (in the classic ones, half a day of neglect would kill it) and also from age. For more information check the wiki http://en.wikipedia.org/wiki/Tamagotchi

Your job is to create a tamagotchi via the command line. The goal is to see how you handle open ended design requirements.

@davidvuong
davidvuong / test.py
Created Jan 9, 2018
Python 3 (no dependency) authenticated request to NetworkOptix (demo)
View test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import base64
import urllib.request
url_request = urllib.request.Request('http://demo.networkoptix.com:7001/ec2/getCamerasEx')
url_request.add_header('Authorization', f'Basic {base64.b64encode(b"demo:nxwitness").decode("utf-8")}')
response = urllib.request.urlopen(url_request)
@davidvuong
davidvuong / TakeHomeTest.md
Last active Jul 27, 2017
Image Intelligence TakeHomeTest
View TakeHomeTest.md

Image Intelligence TakeHome Assignment

Your task is to build an image processing service. A client may send one or many images to your service in the form of JSON. Your service makes an API call to a deep learning platform to detect classes in a set of images. Once the detection is complete, the client gets back a JSON object containing the classes and confidence values of each image sent. For example:

Request:

{
  "images": [
    "http://example.com/image1",
View commit_message_guidelines.md

This gist describes my commit message structure. Its primarily based off AngularJS's commit message guidelines with a few alterations. You can check out their guidelines for more information here.

Overview

type(scope): [<id>] <message>
<new_line>
[<body>]