Skip to content

Instantly share code, notes, and snippets.

{
"workbench.startupEditor": "newUntitledFile",
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe",
"workbench.statusBar.feedback.visible": false,
"files.defaultLanguage": "php",
"editor.fontSize": 16,
"editor.tabSize": 2,
"workbench.editor.tabSizing": "shrink",
"editor.detectIndentation": false,
"editor.insertSpaces": false,
@yuriy-yarvinen
yuriy-yarvinen / cloudSettings
Last active May 28, 2020 08:25
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-02T16:17:44.945Z","extensionVersion":"v3.4.3"}
@yuriy-yarvinen
yuriy-yarvinen / index.php
Created March 17, 2019 21:25
twigBegining
<?php
require_once 'vendor/autoload.php';
$loader = new Twig_Loader_Filesystem('templates');
$twig = new Twig_Environment($loader);
$template = $twig->loadTemplate('template.html');
$array = array( 'data' => array('client1'=> array('id'=>'1','name'=>'jone'),'client2'=> array('id'=>'2','name'=>'mike'),'client3'=> array('id'=>'3','name'=>'jone3'),'client4'=> array('id'=>'4','name'=>'josef'),'client5'=> array('id'=>'5','name'=>'jonesa')) );
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>main</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="../css/style.css">
</head>
@yuriy-yarvinen
yuriy-yarvinen / fields.php
Created March 20, 2019 07:54
wp fields conection
<?
$id = get_the_ID();
$posts = get_posts( array('post_type'=>'postTypeName','numberposts' => 500,) );
$i=0;
foreach( $posts as $post ){
$fields = get_field('fieldName',$post->ID);
if($fields){
foreach ($fields as $field) {
if($id == $field->ID){?>
/opt/php/7.2/bin/php-cgi /var/www/username/data/www/domen.ru/lk/lib/script.php
<style>
.yy-freeorder-title{
text-align: center;
font-size: 36px;
font-weight: 400;
color: #34495e;
margin-bottom: 30px;
}
.yy-freeorder-title-left{
Редирект всех страниц с http:// на https://, в том числе и с http://www на https://
Вариант 1
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
или, если первый вариант не поможет, воспользуйтесь вторым вариантом:
Вариант 2
RewriteEngine On
@yuriy-yarvinen
yuriy-yarvinen / wp-ajax.php
Created March 28, 2019 08:38
wp-ajax.php
add_action( 'wp_ajax_getPage', 'return_filds' ); // wp_ajax_{ЗНАЧЕНИЕ ПАРАМЕТРА ACTION!!}
add_action( 'wp_ajax_nopriv_getPage', 'return_filds' ); // wp_ajax_nopriv_{ЗНАЧЕНИЕ ACTION!!}
// первый хук для авторизованных, второй для не авторизованных пользователей
function return_filds(){
$args = array('post_status' => 'publish');
$pagesID = get_pages($args);
$id = array();
@media (max-width: 1199px){
}
@media (max-width: 991px){
}
@media (max-width: 767px){
}
@media (max-width: 650px){