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 deepClone(obj, visited = new WeakMap()) { | |
// Обработка примитивов и null | |
if (obj === null || typeof obj !== 'object') { | |
return obj; | |
} | |
// Обработка циклических ссылок | |
if (visited.has(obj)) { | |
return visited.get(obj); | |
} |
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
// Файл "tsconfig.json": | |
// - устанавливает корневой каталог проекта TypeScript; | |
// - выполняет настройку параметров компиляции; | |
// - устанавливает файлы проекта. | |
// Присутствие файла "tsconfig.json" в папке указывает TypeScript, что это корневая папка проекта. | |
// Внутри "tsconfig.json" указываются настройки компилятора TypeScript и корневые файлы проекта. | |
// Программа компилятора "tsc" ищет файл "tsconfig.json" сначала в папке, где она расположена, затем поднимается выше и ищет в родительских папках согласно их вложенности друг в друга. | |
// Команда "tsc --project C:\path\to\my\project\folder" берет файл "tsconfig.json" из папки, расположенной по данному пути. | |
// Файл "tsconfig.json" может быть полностью пустым, тогда компилятор скомпилирует все файлы с настройками заданными по умолчанию. | |
// Опции компилятора, перечисленные в командной строке перезаписывают собой опции, заданные в файле "tsconfig.json". |
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 canCode = ({ name }) => { | |
return { code: () => console.log(`${name} is codding ...`) } | |
} | |
const canVueAndJS = ({ name, age }) => { | |
return { | |
vue: () => console.log(`${name}, ${age} years old, is creating Vue.js app ...`), | |
js: () => console.log(`${name}, in his ${age}, is very nice in JS programming ...`) | |
} | |
} |
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
// HTML-форма | |
// Статья: Вменяемая инструкция к PHPMailer “Отправка писем и файлов на почту | |
// Статья: ”Стилизация и кастомизация File Inputs | |
<form class="form" action="#" method="post" id="sendform" enctype="multipart/form-data"> | |
<fieldset> | |
<div class="first-row"> | |
<div class="first-row_first-block"> | |
<input class="first-block__input" name="location" type="text" placeholder="Местонахождение объекта оценки: *" |
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
// Source - https://habr.com/ru/company/ruvds/blog/453586/ | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Lazy Load Images</title> |
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
// ------------------- JS ------------------------- | |
(function() { | |
const myQuestions = [ | |
{ | |
question: "Who is the strongest?", | |
answers: { | |
a: "Superman", | |
b: "The Terminator", | |
c: "Waluigi, obviously" |
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
<?php | |
/** | |
* @package Kinsta_users | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Kinsta users | |
Plugin URI: http://wordpress.org/extend/plugins/# | |
Description: This is an example plugin | |
Author: Carlo Daniele |
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
<?php | |
//Для корректной работы бтблиотеки jQuery в wordpress вместо кода | |
wp_deregister_script('jquery-core'); | |
wp_register_script('jquery-core', 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', false, false, true); | |
wp_enqueue_script( 'jquery' ) | |
//лучше использовать код |
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
<?php | |
/** | |
* ACF создаем своё условие отображения форм на примере рубрик ( дополнительный параметр категории ) | |
* Скрипт написано по мотивам статьи https://wp-kama.ru/plugin/acf/dobavlenie-polej-k-opredelennoj-rubrike | |
* и видео https://www.youtube.com/watch?v=mHJHnyPLf0M&t=39s | |
*/ | |
// Создаем новое правило |
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
<?php | |
datepicker_js(); | |
/** | |
* скрипт выбора даты datepicker | |
*/ | |
function datepicker_js(){ | |
// подключаем все необходимые скрипты: jQuery, jquery-ui, datepicker | |
wp_enqueue_script('jquery-ui-datepicker'); |
NewerOlder