type(scope): subject
<body>
<footer>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const arr1 = [ | |
| ['name', 'id', 'age', 'weight', 'Cool'], | |
| ['Susan', '3', '20', '120', true], | |
| ['John', '1', '21', '150', true], | |
| ['Bob', '2', '23', '90', false], | |
| ['Ben', '4', '20', '100', true], | |
| ]; | |
| const arr2 = [ | |
| ['name', 'id', 'height'], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style> | |
| .spinner { | |
| background-color: transparent; | |
| position: relative; | |
| } | |
| .spinner__square-1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Ajv = require('ajv'); | |
| var ajv = new Ajv({allErrors: true}); | |
| var schema = { | |
| properties: { | |
| country: { type: 'string', enum: ['RU', 'US', 'UZ'] }, | |
| postalCode: { type: 'string', maxLength: 10 } | |
| }, | |
| if: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* range(a, b, pred) { | |
| while (a < b) { | |
| if (typeof pred === 'undefined' || pred(a)) { | |
| yield a; | |
| } | |
| ++a; | |
| } | |
| } | |
| function isPalindrome(val) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const puppeteer = require('puppeteer'); | |
| const width = 1920; | |
| const height = 1080; | |
| (async () => { | |
| await puppeteer.launch({ | |
| headless: false, | |
| args: [ | |
| `--window-size=${Math.floor(width/2)},${height}`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| namespace FormatCompiler | |
| { | |
| using System.Text; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using System.Collections.Generic; | |
| enum TokenType { Unknown, OpenBrace, CloseBrace, Identifier, Literal } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BinaryNode<T> { | |
| public constructor(public value: T, public left: BinaryNode<T> = null, public right: BinaryNode<T> = null) {} | |
| } | |
| interface INodeProcessor<T> { | |
| (value: T): void; | |
| } | |
| interface IBinaryNodeTraversal<T> { | |
| (node: BinaryNode<T>, processor: INodeProcessor<T>): void; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <style> | |
| .step-mediator1 { | |
| position: absolute; | |
| z-index: 30; | |
| } | |
| .step-mediator2 { | |
| position: absolute; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function flatten<T>(arr: Array<T|Array<T>>): Array<T> { | |
| let result: Array<T> = []; | |
| let stack: Array<{ arr: Array<T | Array<T>>, idx: number }> = | |
| [{ arr, idx: 0 }]; | |
| main: while (stack) { | |
| let {arr: current, idx} = stack.pop(); | |
| for (; idx < current.length; idx++) { | |
| if (current[idx] instanceof Array) { | |
| stack.push({arr: current, idx}); | |
| stack.push({arr: <Array<T>>current[idx], idx: 0}); |
NewerOlder