Skip to content

Instantly share code, notes, and snippets.

View lawliet89's full-sized avatar
🧑‍🤝‍🧑
He/him

Yong Wen Chua lawliet89

🧑‍🤝‍🧑
He/him
  • Singapore
  • 07:41 (UTC +08:00)
View GitHub Profile
@lawliet89
lawliet89 / launch_config.tf
Created September 3, 2018 04:38
Terraform Demo Snippet
resource "aws_launch_configuration" "client" {
name_prefix = "${var.client_asg_name}"
image_id = "${data.aws_ami.ubuntu.image_id}"
instance_type = "${var.instance_type}"
user_data = "${data.template_file.client_user_data.rendered}"
associate_public_ip_address = false
security_groups = ["${aws_security_group.client.id}"]
@lawliet89
lawliet89 / asg.tf
Created September 3, 2018 04:37
Terraform Demo Snippet
resource "aws_autoscaling_group" "client" {
launch_configuration = "${aws_launch_configuration.client.name}"
name = "${var.client_asg_name}"
vpc_zone_identifier = "${var.subnet_ids}"
min_size = "${var.client_size}"
max_size = "${var.client_size}"
desired_capacity = "${var.client_size}"
@lawliet89
lawliet89 / variables.tf
Created September 3, 2018 03:37
Terraform Demo Snippets
#######################################
# Optional Variables
#######################################
variable "aws_region" {
description = "Region to deploy to"
default = "ap-southeast-1"
}
variable "tags" {
description = "Tags to add to all resources that support tags"
@lawliet89
lawliet89 / variables.tf
Last active September 3, 2018 03:37
Terraform Demo Snippets
#######################################
# Required Variables
#######################################
variable "vpc_id" {
description = "VPC ID to launch resources in"
}
variable "subnet_ids" {
description = "A list of subnet IDs to launch instances in."
type = "list"
@lawliet89
lawliet89 / main.tf
Last active September 3, 2018 02:55
Terraform Demo Snippets
# The "main" file defines the providers and some other "main" things
provider "aws" {
version = "~> 1.33"
region = "${var.aws_region}"
}
locals {
client_port = 8080
server_port = 8084
@lawliet89
lawliet89 / README.md
Last active August 2, 2018 02:27
Github Labels
@lawliet89
lawliet89 / issues.md
Created January 22, 2018 09:07
Parity POA Issues

Issues with Assembly in Contract

Validator Contract

pragma solidity ^0.4.15;

contract ValidatorSet {
	/// Issue this log event to signal a desired change in validator set.
	/// This will not lead to a change in active validator set until
@lawliet89
lawliet89 / diesel.rs
Created September 22, 2017 02:13
Diesel DB Agnostic Struct
#[macro_use]
extern crate diesel;
#[macro_use]
extern crate diesel_codegen;
extern crate r2d2;
extern crate r2d2_diesel;
use r2d2::{ManageConnection, PooledConnection};
use r2d2_diesel::ConnectionManager;
@lawliet89
lawliet89 / ice.rs
Created July 21, 2017 06:47
rustc ICE Cargo Expand
#![feature(prelude_import)]
#![no_std]
#![feature(plugin, custom_derive, conservative_impl_trait)]
#![plugin(rocket_codegen)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
extern crate rocket;
@lawliet89
lawliet89 / expand.rs
Created July 14, 2017 14:31
Rocket lifetime cargo expand
#![feature(prelude_import)]
#![no_std]
#![feature(plugin, custom_derive)]
#![plugin(rocket_codegen)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std as std;
extern crate rocket;