Hello {{name}} !!
{{! This is a comment, and it won't be rendered }}
| var a = [ -2, 1, -3, 4, -1, 2, 1, -5, 4 ], | |
| now = 0, | |
| prev = 0; | |
| for ( var i = 0; i < a.length; i++ ) { | |
| prev = Math.max( 0, prev + a[ i ] ); | |
| now = Math.max( prev, now ); | |
| } | |
| console.log( now ); // 6 |
| .container{ | |
| display: flex; | |
| flex-direction: row | row-reverse | column | column-reverse; | |
| flex-wrap: nowrap | wrap | wrap-reverse; | |
| flex-flow: <‘flex-direction’> || <‘flex-wrap’>; | |
| justify-content: flex-start | flex-end | center | space-between | space-around; // horizontally | |
| align-items: flex-start | flex-end | center | baseline | stretch; // vertical-align | |
| align-content: flex-start | flex-end | center | space-between | space-around | stretch; //multi line repartition | |
| } |
| # POST a JSON file and redirect output to stdout | |
| wget -q -O - --header="Content-Type:application/json" --post-file=foo.json http://127.0.0.1 | |
| # Download a complete website | |
| wget -m -r -linf -k -p -q -E -e robots=off http://127.0.0.1 | |
| # But it may be sufficient | |
| wget -mpk http://127.0.0.1 | |
| # Download all images of a website |
| for FILE in $(find . -name "*.svg"); do | |
| grep -qR $(basename "$FILE") * || echo "you can remove $FILE" | |
| done |
| const getDistance = (A, B) => Math.sqrt( Math.pow( B.x - A.x, 2 ) + Math.pow( B.y - A.y, 2 ) ); |
| class Car { | |
| constructor(size, price, maxSpeed) { | |
| this.size = size; | |
| this.price = price; | |
| this.maxSpeed = maxSpeed; | |
| } | |
| } | |
| class CarFactory { |
| class MealBuilder { | |
| init() { | |
| this.meal = new Meal(); | |
| } | |
| addMain(type) { | |
| this.meal.main = new MainItem(type); | |
| } |
| class Singleton { | |
| constructor() { | |
| if (typeof Singleton.instance === 'object') { | |
| return Singleton.instance; | |
| } | |
| Singleton.instance = this; | |
| return this; |
| class Sheep { | |
| constructor(name, weight) { | |
| Object.assign(this, { name, weight }); | |
| } | |
| clone() { | |
| return new Sheep(this.name, this.weight); | |
| } |