Skip to content

Instantly share code, notes, and snippets.

View sxidsvit's full-sized avatar

Sergiy Antonyuk sxidsvit

View GitHub Profile
// Файл "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".
@sxidsvit
sxidsvit / kinsta_users.php
Created May 22, 2019 21:58 — forked from carlodaniele/kinsta_users.php
A plugin for registering a custom post type with a specific set of capabilities
<?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
// First Register the Tab by hooking into the 'woocommerce_product_data_tabs' filter
add_filter( 'woocommerce_product_data_tabs', 'add_my_custom_product_data_tab' );
function add_my_custom_product_data_tab( $product_data_tabs ) {
$product_data_tabs['my-custom-tab'] = array(
'label' => __( 'My Custom Tab', 'my_text_domain' ),
'target' => 'my_custom_product_data',
);
return $product_data_tabs;
}
@sxidsvit
sxidsvit / wpcf-redirect-NEW.php
Created August 28, 2018 01:36 — forked from campusboy87/wpcf-redirect-NEW.php
Contact Form 7 Redirect
<?php
/**
* Plugin Name: WPCF Redirect
*/
add_filter( 'shortcode_atts_wpcf7', 'shortcode_atts_wpcf7' );
add_filter( 'wpcf7_editor_panels', 'wpcf7_add_redirect_panels' );
add_action( 'wpcf7_after_save', 'wpcf7_redirect_save_field' );
add_action( 'wp_footer', 'wpcf7_redirect_enqueue_assets' );
@sxidsvit
sxidsvit / code_editor_for_contact_form_7.php
Created July 17, 2018 19:51 — forked from campusboy87/code_editor_for_contact_form_7.php
Code Editor for Contact Form 7 (WordPress / CodeMirror).
<?php
/**
* Plugin Name: Code Editor for Contact Form 7
* Plugin URI: https://gist.github.com/campusboy87/2daad24e45116721759991549b626977
* Author: Campusboy (wp-plus)
* Author URI: https://www.youtube.com/wp-plus
*/
add_action( 'admin_print_styles-toplevel_page_wpcf7', function () {
@sxidsvit
sxidsvit / wp-comment-callback
Created June 30, 2018 12:30 — forked from georgiecel/wp-comment-callback
Custom callback for HTML5 friendly WordPress comment. Also includes schema.org microdata. To use, insert the following into comments.php: <?php wp_list_comments('callback=better_comment&end-callback=better_comment_close'); ?>
// awesome semantic comment
function better_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
if ( 'article' == $args['style'] ) {
$tag = 'article';
$add_below = 'comment';
} else {
@sxidsvit
sxidsvit / amimation_blocks_plugin
Created June 22, 2018 11:41 — forked from Scretch-1/amimation_blocks_plugin
Анимация блоков при скролле страницы
//Для начала подключаем animate_plugin
//Далее подключаем плагин waypoints https://github.com/imakewebthings/waypoints
//Далее на странице подключаем "animate" стили в
<head>
<link rel="stylesheet" href="libs/animate-plugin/animate.min.css">
</head>
//После в самом низу тега
<body>
<script type="text/javascript" src="libs/animate-plugin/animate-css.js"></script>
<script type="text/javascript" src="libs/animate-plugin/jquery.waypoints.min.js"></script>
@sxidsvit
sxidsvit / gulpfile_bootstrap4.js
Last active April 23, 2018 00:12 — forked from Insayt/gulpfile.js
D.Valak - gulpfile for Bootstrap 4
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
cssmin = require('gulp-minify-css'),
@sxidsvit
sxidsvit / wp_security_setting
Created March 3, 2018 23:07 — forked from artikus11/wp_security_setting
Настройки для плагина All In One WP Security
{"aiowps_enable_debug":"","aiowps_remove_wp_generator_meta_info":"1","aiowps_prevent_hotlinking":"1","aiowps_enable_login_lockdown":"1","aiowps_allow_unlock_requests":"","aiowps_max_login_attempts":3,"aiowps_retry_time_period":5,"aiowps_lockout_time_length":60,"aiowps_set_generic_login_msg":"","aiowps_enable_email_notify":"","aiowps_email_address":"9698114@mail.ru","aiowps_enable_forced_logout":"","aiowps_logout_time_period":"60","aiowps_enable_invalid_username_lockdown":"","aiowps_instantly_lockout_specific_usernames":[],"aiowps_unlock_request_secret_key":"9boae3otjbi5x7b7q6kf","aiowps_enable_whitelisting":"","aiowps_allowed_ip_addresses":"","aiowps_enable_login_captcha":"","aiowps_enable_custom_login_captcha":"","aiowps_captcha_secret_key":"y9t13745ja38h0dirf5q","aiowps_enable_manual_registration_approval":"","aiowps_enable_registration_page_captcha":"","aiowps_enable_random_prefix":"","aiowps_enable_automated_backups":"1","aiowps_db_backup_frequency":2,"aiowps_db_backup_interval":"2","aiowps_backup_files_s
@sxidsvit
sxidsvit / Браузерное кеширование
Created February 28, 2018 18:27 — forked from artikus11/.htaccess
Заготовка для подключения браузерного кеширования
Включение кеша браузера
Вариант 1
<ifModule mod_headers.c>
<FilesMatch "\.(js|css|txt)$">
Header set Cache-Control "max-age=604800"
</FilesMatch>
<FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
Header set Cache-Control "max-age=2592000"