Hello {{name}} !!
{{! This is a comment, and it won't be rendered }}
| #!/usr/bin/env node | |
| const http = require('http'); | |
| const url = require('url'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const [ runtime, scriptName, port = 3000, folder = process.cwd() ] = process.argv; | |
| class Server { |
| class ShoppingCart { | |
| constructor(discount) { | |
| this.discount = new discount(); | |
| this.amount = 0; | |
| } | |
| checkout() { | |
| return this.discount.apply(this.amount); | |
| } |
| class OrderStatus { | |
| constructor(name, nextStatus) { | |
| this.name = name; | |
| this.nextStatus = nextStatus; | |
| } | |
| doSomething() { | |
| console.log('Do nothing by default'); | |
| } |
| class Sheep { | |
| constructor(name, weight) { | |
| Object.assign(this, { name, weight }); | |
| } | |
| clone() { | |
| return new Sheep(this.name, this.weight); | |
| } |
| class Singleton { | |
| constructor() { | |
| if (typeof Singleton.instance === 'object') { | |
| return Singleton.instance; | |
| } | |
| Singleton.instance = this; | |
| return this; |
| class MealBuilder { | |
| init() { | |
| this.meal = new Meal(); | |
| } | |
| addMain(type) { | |
| this.meal.main = new MainItem(type); | |
| } |
| class Car { | |
| constructor(size, price, maxSpeed) { | |
| this.size = size; | |
| this.price = price; | |
| this.maxSpeed = maxSpeed; | |
| } | |
| } | |
| class CarFactory { |
| const getDistance = (A, B) => Math.sqrt( Math.pow( B.x - A.x, 2 ) + Math.pow( B.y - A.y, 2 ) ); |
| for FILE in $(find . -name "*.svg"); do | |
| grep -qR $(basename "$FILE") * || echo "you can remove $FILE" | |
| done |