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
export const API = { | |
getDirections: 'getDirections', | |
// others | |
} | |
const stringifyQuery = (query) => !isEmpty(query) ? `?${qs.stringify(query)}` : '' | |
const API_URLS = { | |
[API.getDirections]: (params, query) => `${__DOMAIN__}/backend/api/directions/${params.direction}${stringifyQuery(query)}` | |
} |
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
/** | |
* Дано: день пребывания в отеле в рабочий день стоит 1000р, а в выходной 1500р. Задача: написать код который посчитает стоимость за пребывание в течении X дней с указанной даты | |
*/ | |
const weekdayPrice = 1000; | |
const weekendsPrice = 1500; | |
// version 1 | |
const stayCost1 = (daysAmount, startDate = new Date()) => { | |
const currentDay = startDate.getDay(); |
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
"use strict"; | |
var _excluded = ["type", "state"]; | |
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | |
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | |
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } |
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
// студент еще не разу не проходил тест | |
{ | |
"passed": false, | |
"percent": null | |
} | |
// при прохождении успешном прохождении с первого или второго раза | |
{ |
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
CLAN_ID = 1 | |
clan = Clan.find(CLAN_ID) | |
character_ids = ClanMember.connection.select_values( | |
ClanMember.send(:sanitize_sql, ["SELECT character_id FROM clan_members WHERE clan_id = :clan", :clan => clan.id]) | |
) | |
position = 0 |