Skip to content

Instantly share code, notes, and snippets.

View sshplendid's full-sized avatar
Backend ⚪️ Frontend 🔘Weekend

SeHun Shin sshplendid

Backend ⚪️ Frontend 🔘Weekend
View GitHub Profile
@sshplendid
sshplendid / raceButAll.js
Last active September 21, 2020 05:45
Promise.race 상황에서 나머지 프로미스를 처리하려면?
// Promise 생성기
function getPromise(msg, timeout) {
return new Promise((res, rej) => {
setTimeout(() => {
res(msg)
}, timeout || 1000)
})
}
// race처럼 첫 번째를 처리하고 나머지도 처리기를 붙여놓음
@sshplendid
sshplendid / cf-ec2.yml
Created November 22, 2019 15:21
클라우드 포메이션을 사용해서 (1) VPC 스택을 생성하고, 퍼블릭 서브넷에 (2) EC2 인스턴스를 생성하는 스택 템플릿
AWSTemplateFormatVersion: 2010-09-09
Description: stack description
Parameters:
EC2KeyPair:
Description: EC2 keypair name
Type: AWS::EC2::KeyPair::KeyName
Default: 'EC2 tutorial'
myStamp:
Description: My Stamp
Type: String
Outputs: {}
AWSTemplateFormatVersion: 2010-09-09
Parameters:
InstanceTypeFamily:
NoEcho: 'true'
Type: String
Description: WebServer EC2 instance type family
Default: t2
LogPublicationControl:
NoEcho: 'true'
Outputs: {}
AWSTemplateFormatVersion: 2010-09-09
Parameters:
InstanceTypeFamily:
NoEcho: 'true'
Type: String
Description: WebServer EC2 instance type family
Default: t2
LogPublicationControl:
NoEcho: 'true'
@sshplendid
sshplendid / cloudformation-single-web-server.yml
Last active November 18, 2019 15:23
CloudFormation template for single EC2 web server
AWSTemplateFormatVersion: 2010-09-09
Metadata:
MyMeta:
apple: red
bannna: yellow
Parameters:
owner:
Description: This stack owner's name
Type: String
Default: 'Shawn'