Skip to content

Instantly share code, notes, and snippets.

@wingleungchoi
wingleungchoi / AWSReminders.md
Last active October 2, 2023 16:32
Reminder for myself

I am new to terraform and AWS networking. I have the following tips. Hope people may find them useful.

  • Draw your AWS Architecture Diagram
    • which provides an anchor and north star during builing your infrastructure
  • Need to create internet gateway for new created VPC.
    • It is because default VPC in AWS comes with default internet gateway.
    • but new created VPC does not have default internet gateway.
  • Need to create NAT gateway for resources (e.g. ec2) in private subnets to access internet (egress traffic)
    • note: egress traffic means internet requests FROM the resources
  • Need to create security group for resources in private subnet
@wingleungchoi
wingleungchoi / SyncPool.md
Last active July 20, 2021 09:27
It is my summary after viewing justforfunc video about Sync.Pool and other articles I read
@wingleungchoi
wingleungchoi / Dog.js
Created May 6, 2019 14:23
Dog Class example in Javascript
class Dog {
constructor(nameOrDog = '') {
if (nameOrDog instanceof Dog) {
this.name = nameOrDog.getName();
} else if ((typeof nameOrDog) === 'string') {
this.name = nameOrDog;
} else {
// throw new Error('type is not supported');
}
}
@wingleungchoi
wingleungchoi / Dog.java
Created May 6, 2019 14:22
Dog Java Example
public class Dog {
// Attributes [i.e. data]
private String name;
// Behavior [i.e. methods]
// Constructors
public Dog() //constructor which takes no parameters, sets to default
{
name="";
}
// fully parameterized constructor
@wingleungchoi
wingleungchoi / gist:50d3d2c1cc4420738b24
Created January 15, 2015 17:22
my basic understanding of frontend JS framework
This is my basic understanding of frontend JS framework. Feel free to comment it.
Javascreipt Framework help you build a "responsive" website.
Traditionaly, the sever will give a response which consist of Webpages(HTML + CSS), assets(Images, video, sounds...) + JavaScript when browser send a requests.
There is a new way to communicate between browser and sever by using AJAX. Instead of bulks of data, sever will give a response in XML or JSON( a text format). Once browser get and load it, it will update the existing page rather than regenerate a webpage from null.
Responding in format of JSON is breakthrough. Base on a new communication, Using a JavaScript can create a website is responsive and dynamic in frontend and possible to skip backend if you just use third parties API and no backend code is written by yourself.
@wingleungchoi
wingleungchoi / gist:957b76f3905b181cc836
Created January 3, 2015 07:04
Six basic types of values in JavaScript
Six basic types of values in JavaScript: numbers, strings, Booleans, objects, functions, and undefined values.
JavaScript is a very free language. It tries to converse the type of a value to another type. There are pros and cons. Pros: more flexible a code can be. Cons: more errors a code can have.
As a beginner, prefer === rather than ==