Skip to content

Instantly share code, notes, and snippets.

@korECM
korECM / index.js
Last active February 13, 2020 17:32
AWS Lambda 크롤링
const chromium = require('chrome-aws-lambda');
module.exports.handler = async (event, context) => {
const browser = await chromium.puppeteer.launch({
executablePath: await chromium.executablePath,
args: chromium.args,
defaultViewport: chromium.defaultViewport,
headless: chromium.headless,
});
@korECM
korECM / FirstBeverageAbstractClass.ts
Created July 11, 2020 14:56
First Beverage Abstract Class
abstract class Beverage {
protected description: string;
getDescription(): string {
return this.description;
}
abstract cost(): number;
}
class Espresso extends Beverage {
constructor() {
super();
this.description = "에스프레소~";
}
cost() {
return 3000;
}
}
class EspressoIce extends Beverage {
constructor() {
super();
this.description = "에스프레소~";
}
cost() {
return 3500;
}
}
class GreenTea extends Beverage {
constructor() {
super();
this.description = "그린티~";
}
cost() {
return 3500;
}
}
abstract class Beverage {
protected description: string;
private ice: boolean; // 얼름
private mocha: boolean; // 모카
private whip: boolean; // 휘핑
getDescription(): string {
return this.description;
}
abstract class Beverage {
protected description: string;
public getDescription(): string {
return this.description;
}
abstract cost(): number;
}
class Americano extends Beverage {
constructor() {
super();
this.description = "아메리카노";
}
cost() {
return 3000;
}
}
abstract class BeverageDecorator extends Beverage {
abstract getDescription(): string;
}
class Ice extends BeverageDecorator {
private beverage: Beverage;
constructor(beverage: Beverage) {
super();
this.beverage = beverage;
}
getDescription() {
return this.beverage.getDescription() + ", 아이스";
}