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
| import dotenv from "dotenv"; | |
| import fs from "fs"; | |
| import path from "path"; | |
| import { fileURLToPath } from "url"; | |
| // Инициализация .env | |
| dotenv.config(); | |
| // Получение текущей директории (эквивалент __dirname в CommonJS) | |
| const __filename = fileURLToPath(import.meta.url); |
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 drawTo(context, n, dx, dy) { | |
| const pattern = [0, 5, 10, 5, 0]; // Определение паттерна | |
| for (let y = 0; y <= 4; y++) { | |
| for (let x = 0; x <= 4; x++) { | |
| const bit = pattern[x] + y; | |
| if ((n & (1 << bit)) !== 0) { | |
| context.fillRect(dx + x, dy + y, 1, 1); // Рисуем пиксель | |
| } | |
| } | |
| } |
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
| { | |
| "paid":true, | |
| "point":0, | |
| "pointTime":0, | |
| "project":1, | |
| "data":{ | |
| "Document":{ | |
| "Id":122531, | |
| "IdShift":21072, | |
| "IdUser":3052, |
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
| import React, { Component } from "react"; | |
| import { render } from "react-dom"; | |
| import "./index.css"; | |
| class Widget extends Component { | |
| state = { text: "" }; | |
| handleChange = (e) => { | |
| this.setState({ text: e.target.value }); | |
| }; | |
| render() { |
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. Добавляем id контейнеру с радиокнопками для выбора пользователя --> | |
| <div class="form-group" id="reg_type"> | |
| ... | |
| </div> | |
| <!-- 2. Под этот контейнер ставим сообщение об ошибке --> | |
| <div class="alert alert-danger" style="display:none" id="regTypeAlert"> | |
| <strong>Не выбран тип пользователя</strong><br/> | |
| Без него вы не сможете заполнить данные для участия в мероприятиях. | |
| </div> |
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
| <!-- Композиция поведения в AngularJS --> | |
| <dog murder robot></dog> | |
| <!-- Нужно что-то ещё? Записывам в шаблон ещё одну директиву --> | |
| <dog murder robot other-behavior></dog> | |
| <!-- React-подход? --> | |
| <MurderRobotDog /> |
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
| /** | |
| * IE 5.5+, Firefox, Opera, Chrome, Safari XHR object | |
| * | |
| * @param string url | |
| * @param object callback | |
| * @param mixed data | |
| * @param null x | |
| */ | |
| function ajax(url, callback, data, x) { | |
| try { |
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 camelCaseToDash( myStr ) { | |
| return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase(); | |
| } | |
| var myStr = camelCaseToDash( 'thisString' ); | |
| alert( myStr ); // => this-string |
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 clickOutside( $document ) { | |
| const isOutSide = (el, evt) => el !== evt.target && !el[0].contains( evt.target ); | |
| const link = ( scope, el ) => $document.on( | |
| 'click', | |
| evt => { | |
| if ( isOutSide(el, evt) ) scope.$eval( scope.clickOutside ); | |
| } | |
| ); |
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
| /* Buttons group */ | |
| .buttons-group { | |
| .clearfix; | |
| display: inline-block; | |
| vertical-align: bottom; | |
| & .button { |
NewerOlder