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
/** | |
* Сначала сравниваем длину строки и определяем строки с максимальной длиной и складываем | |
* в отдельный массив. | |
* После этого классическим образом сортируем строки и получаем максимальный элемент. | |
* Подходит для любого колчиства параметров | |
* | |
* @param args строки для сравнения | |
*/ | |
const solve = (...args) => { | |
if (!args.length) return; |
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
const leaflet = jest.mock(`leaflet`); | |
const tileLayer = { | |
addTo() { | |
return {}; | |
} | |
}; | |
const marker = { | |
addTo() { |
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 Chart from "chart.js"; | |
import ChartDataLabels from "chartjs-plugin-datalabels"; | |
const moneyCtx = document.querySelector('.money-chart'); | |
const moneyChart = new Chart(moneyCtx, { | |
plugins: [ChartDataLabels], | |
type: `horizontalBar`, | |
data: { | |
labels: [`✈️FLY`, `🏨 STAY`, `🚕 TAXI`, `🏛️ LOOK`, `🍴 EAT`, `🚗 DRIVE`, `🛳️ SAIL`, `🚂 TRAIN`, `🚌 BUS`], |
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
const getFeatureCheckboxs = (feature) => { | |
const { offers, type } = feature; | |
return offers.reduce((res, offer, i) => { | |
return res + ` | |
<input id="event-offer-${type}-${i}" type="checkbox" name="event-offer-${type}"> | |
<label for="event-offer-${type}-${i}">${offer.title}</label> | |
`; | |
}, '') | |
}; |
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. users. Таблица содержит информацию о пользователях | |
- user_id (integer). Уникальный идентификатор пользователя | |
- name (char). Имя пользователя | |
- email (char). Email пользователя | |
2. statuses. Таблица содержит информацию о статусах задач. |
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 CBR_ENTRYPOINT = "https://www.cbr.ru/scripts/XML_daily.asp"; | |
/** | |
* Получаем курс ЦБ на дату | |
* | |
* @param {string} currency - код валюты | |
* @param {Date} date - день | |
* @return {Number} | |
* @customfunction | |
*/ |
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 ENTRYPOINT = "https://www.statbureau.org/calculate-inflation-rate-json"; | |
/** | |
* Получаем инфлацию за произвольный период | |
* | |
* @param {string} country - страна (belarus, brazil, canada, european-union, eurozone, france, germany, greece, india, japan, kazakhstan, mexico, russia, spain, turkey, ukraine, united-kingdom, united-states) | |
* @param {Date} start - первый месяц, включительно | |
* @param {Date} end - последний месяц, включительно | |
* @return Получаем инфляцию за произвольный период | |
* @customfunction |
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 MicexApi = {}; | |
// список id разных типов ЦБ | |
var BOARD_ID = { | |
STOCK: 'TQBR', | |
ETF: 'TQTF', | |
BONDS: 'EQOB' | |
}; | |
(function(App) { | |
var MICEX_ENTRYPOINT = 'https://iss.moex.com/iss/'; |
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
if (typeof Object.assign !== 'function') { | |
Object.defineProperty(Object, "assign", { | |
value: function assign(target, varArgs) { // .length of function is 2 | |
if (target === null || target === undefined) { | |
throw new TypeError('Cannot convert undefined or null to object'); | |
} | |
var to = Object(target); | |
for (var index = 1; index < arguments.length; index++) { |
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 CGI = {}; | |
CGI.buildQueryParams = function(params) { | |
var res = []; | |
for(var key in params) { | |
res.push(key + '=' + params[key]); | |
} | |
return res.length > 0 ? '?' + res.join('&') : ''; | |
}; |