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
| { | |
| "root": true, | |
| "levels": { | |
| "common.blocks": { | |
| scheme: "nested", | |
| default: true | |
| }, | |
| "desktop.blocks": { | |
| scheme: "nested" | |
| }, |
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
| 2000 | |
| 800000508 | |
| 800000281 | |
| 800001032 | |
| 800000783 | |
| 800000010 | |
| 800000783 | |
| 800000431 | |
| 800001185 | |
| 800000724 |
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
| #!/bin/sh | |
| # RUN latest version: | |
| # wget https://github.yandex-team.ru/gist/invntrm/8e42ab1cd74966541a65/raw/express.js.init.sh && chmod a+x express.js.init.sh && ./express.js.init.sh && rm express.js.init.sh | |
| # **NOT** USE: wget -qO- https://github.yandex-team.ru/gist/invntrm/8e42ab1cd74966541a65/raw/express.js.init.sh | sh | |
| git init | |
| # | |
| # install some npm modules |
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
| # -*- coding: utf-8 -*- | |
| #!/usr/bin/python | |
| import subprocess | |
| import os | |
| import picamera | |
| import time | |
| import shlex | |
| from datetime import datetime | |
| from datetime import timedelta | |
| import datetime as dt |
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 isBalanced = (() => { | |
| const map = {'(':')', '[':']', '{':'}'} | |
| const getPair = char => map[char] | |
| const isOpen = char => ['(','[','{'].includes(char) | |
| return s => { | |
| const stack = [] | |
| return Array.from(s).reduce((res, char) => res && (isOpen(char) ? (stack.push(char), true) : (char === getPair(stack.pop()))), true) | |
| && !stack.length | |
| } | |
| })() |
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 fuzzycheck = (candidate, origin) => | |
| !Array.from(origin).reduce((candRest, origChar) => origChar === candRest[0] ? candRest.slice(1) : candRest, candidate) | |
| .length | |
| console.log(fuzzycheck('rw2', 'rogers watson 2')) |
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 diff = (() => { | |
| let tmp = '' | |
| let cnt = 0 | |
| const reduce = (s2, c1, i) => { | |
| c1 !== (tmp = s2.shift()) && (++cnt, console.warn(c1, '<>', tmp, 'at', i)) | |
| return s2 | |
| } | |
| return (s1, s2) => { | |
| cnt = 0 |
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 rle = (() => { | |
| let cnt = 1, tmp | |
| const printCnt = cnt => cnt !== 1 ? cnt : '' | |
| const reduce = (res, next) => | |
| next === res[res.length - 1] ? (++cnt, res) : (tmp = cnt, cnt = 1, res + printCnt(tmp) + next) | |
| return s => Array.from(s).reduce(reduce, '') + printCnt(cnt) | |
| })() | |
| rle('AAAABBBCCXYZDDDDEEEFFFAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBB') === 'A4B3C2XYZD4E3F3A6B28' |
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 ops = ['+', '-', '*', '/']; | |
| function calc(expr) { | |
| const stack = expr.split(/\s+/) | |
| .reduce((stack, char) => { | |
| if (ops.includes(char)) { // is operator | |
| if (stack.length < 2) throw new Error('There are not enough operands in the stack: ' + stack); | |
| const b = stack.pop(), a = stack.pop(); | |
| let res; | |
| const subExpr = `(${a}) ${char} (${b})`; | |
| try { res = eval(subExpr); } catch (e) { |
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
| <svg id="svg" width="270" height="270" xmlns="http://www.w3.org/2000/svg" stroke-width="5" stroke="#61B000"> | |
| <linearGradient id="mainGradient" gradientUnits="userSpaceOnUse" x1="0%" y1="100%" x2="0%" y2="0%"><stop class="stop-right" offset="0" stop-opacity="0" stop-color="green"></stop><stop class="stop-left" offset="1" stop-color="green" stop-opacity=".6"></stop></linearGradient> | |
| <path id="p1" fill="none" stroke="none"></path> | |
| <path stroke="green" id="p2" fill="none" stroke-width="2"></path> | |
| </svg> | |
| <script> | |
| var vals = [84307, 80323, 86134, 70500]; | |
| function plot (svg, vals) { |