This file contains 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
export default function sum(...numbers: number[]): number { | |
return numbers.reduce((sum: number, currentNumber: number) => ( | |
(Math.round(sum * 100) + Math.round(currentNumber * 100)) / 100 | |
), 0); | |
} |
This file contains 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
import { Directive, HostListener, Input, OnDestroy, OnInit } from '@angular/core'; | |
@Directive({ | |
selector: '[copyToClipboard]' | |
}) | |
export class CopyToClipboardDirective implements OnInit, OnDestroy { | |
private static copyableElement: HTMLTextAreaElement; | |
private static createCopyableElement(): void { |
This file contains 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
import { Pipe, PipeTransform } from '@angular/core'; | |
interface ParsedPhone { | |
code: string; | |
mainPart: string; | |
} | |
@Pipe({ | |
name: 'prettifyPhone' | |
}) |
This file contains 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 Slider = (function($) { | |
function Slider(options) { | |
this.viewport = $(options.viewport); | |
this.leftLink = $(options.leftLink); | |
this.rightLink = $(options.rightLink); | |
this.slides = $(options.slides); | |
this.init(); | |
} |
This file contains 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
# encoding: UTF-8 | |
require "open-uri" | |
require "json" | |
module YandexSlovari | |
module YAPI | |
SERVICES = { | |
dictionary: { |
This file contains 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 () { | |
var defaults = { | |
defaultsPropertyName: "defaults" | |
}; | |
/** | |
* Реализует простое наследование | |
* | |
* @param {Function} constructor Функция-конструктор класса-родителя |
This file contains 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
/** | |
* Реализует Блок в терминах БЭМ | |
* | |
* @requires jQuery | |
* @requires ObjectUtils | |
* | |
* @param {?String} blockName Имя блока | |
* @param {?jQuery} block jQuery-представление DOM-элемента блока | |
* | |
* @constructor |
This file contains 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/zsh | |
function lintit () { | |
OUTPUT=$(git diff --name-only | grep -E '(.js)$') | |
a=("${(f)OUTPUT}") | |
e=$(eslint -c .eslint.json $a) | |
echo $e | |
if [[ "$e" != *"0 problems"* ]]; then | |
echo "ERROR: Check eslint hints." | |
exit 1 # reject |
This file contains 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
Не переносится по дефису слово пин-код. |
This file contains 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
1. Общие принципы: Use the keyboard, Luke | |
Упор на горячие клавиши. Мышь — медленно, клавиатура — быстро. Модель GOMS это подтверждает. | |
Что такое модель GOMS? | |
Подход к количественному анализу моделей интерфейсов. | |
Перевод: правила для целей, объектов, методов и выделения (the model of goals, objects, methods and selection rules). | |
Позволяет предсказать, сколько времени потребуется опытному пользователю на выполнение конкретной операции. | |
K = 0,2 c — нажатие клавиши; |
NewerOlder