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
| FROM python:3.9-alpine | |
| RUN mkdir /app | |
| WORKDIR /app | |
| COPY . /app | |
| CMD ["python", "app.py"] |
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
| /** | |
| * Преобразование количества "цифрой" в количество "словом" | |
| * Чтобы было удобнее формировать массивы со склонениями, запомните ряд чисел 1-2-5, | |
| * а потом мысленно подставляйте их в массив: (один "рубль", два "рубля", пять "рублей") | |
| * $num = 3; | |
| * $words = array('новость', 'новости', 'новостей'); | |
| * echo $num . ' ' . num_2_word($num, $words); // сколько новостей | |
| * | |
| * @param $n | |
| * @param $words |
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'; | |
| // Функция для работы с localStorage | |
| const getStoredValue = (key, defaultValue) => localStorage.getItem(key) || defaultValue; | |
| const setStoredValue = (key, value) => localStorage.setItem(key, value); | |
| // Функции для установки фронт-темы и фронт-иконки | |
| const setFrontTheme = theme => document.documentElement.setAttribute('data-bs-theme', theme); | |
| const setFrontThemeIcon = themeIcon => document.querySelector('#themeIcon').setAttribute('xlink:href', themeIcon); |
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 user = { | |
| age: 22, | |
| gender: 'male', | |
| address: { | |
| city: 'Kyiv' | |
| } | |
| } | |
| // Copying objects | |
| const user2 = user; // assignment of reference |
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 greet(person: string, date: Date): void { | |
| console.log(`Hello, ${person}! Today is ${date.toDateString()}.`); | |
| } | |
| const getFullName = (first: string, last?: string): string => | |
| last ? `${first} ${last}` : `${first}`; | |
| let fullName = getFullName("John"); | |
| greet(fullName, new Date()); |
OlderNewer