Skip to content

Instantly share code, notes, and snippets.

@Arahort
Arahort / Test php function mail()
Last active May 22, 2018 07:26
Script for testing mail() function
<?php
// если была нажата кнопка "Отправить"
if($_POST['submit']) {
// $_POST['title'] содержит данные из поля "Тема"
$title = 'TEST';
@Arahort
Arahort / JSON-LD microdata LocalBusiness
Created May 22, 2018 07:23
Microdata LocalBusiness
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "LocalBusiness",
"branchOf": {
"@type": "Organization",
"legalName": "Название фирмы (компании, организации), филиалом которой является ваш бизнес или офис",
"alternateName": "Альтернативное название основной компании"
},
"address": {
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Store",
"name":"ООО «Мебель Легко»",
"address":{
"@type":"PostalAddress",
"streetAddress":" ш. Революции, 69",
"addressLocality":"Санкт-Петербург",
"addressRegion":"Ленинградская область",
@Arahort
Arahort / JSON-LD microdata Contacts
Last active May 22, 2018 07:20
Microdata contacts
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
"name" : "Alex Arahort Portal",
"url" : "https://arahort.pro/",
"logo": "https://arahort.pro/images/logo_head2.png",
"address":{
"@type":"PostalAddress",
"streetAddress":" ул. Радищева 5",
@Arahort
Arahort / install
Created May 22, 2018 07:01 — forked from agragregra/install
Fast Install Node.js, Gulp & Jekyll into Windows 10/Ubuntu/Mint
sudo apt-add-repository -y ppa:brightbox/ruby-ng; sudo apt-get update; sudo apt-get -y install curl ruby2.5 ruby2.5-dev gcc make g++ libffi-dev; curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -; sudo apt-get -y install nodejs; sudo gem i jekyll -v 3.7.2; sudo gem i jekyll-paginate-v2; sudo npm i -g gulp rimraf npm-check-updates; sudo chown -R $USER:$(id -gn $USER) /home/$USER/.config
@Arahort
Arahort / Redirect lowercase
Last active May 22, 2018 07:11
Redirect to lower case with the exception of GET
<?php
if ( $_SERVER['REQUEST_URI'] != strtolower( $_SERVER['REQUEST_URI']) ) {
$urlHaveGet = '/\?/i';
if(preg_match($urlHaveGet, $_SERVER['REQUEST_URI']) == 0){
header('Location: http://'.$_SERVER['HTTP_HOST'] . strtolower($_SERVER['REQUEST_URI']), true, 301);
exit();
}
}
?>
@Arahort
Arahort / Yandex reachGoal
Last active May 22, 2018 07:10
Yandex reachGoal jQuery script
<script>
jQuery(document).ready(function(){
jQuery('.class').click(function() {
yaCounterXXXXXX.reachGoal('YYYYYY');
console.log('YYYYYY');
});
});
</script>
@Arahort
Arahort / phpStorm "find in path"
Created May 19, 2018 08:57
Restore old "find in path" dialog in phpStorm
`-Dide.find.as.popup=false` in Help | Edit Custom VM Options
@Arahort
Arahort / Hide elements in menu.
Last active May 22, 2018 06:46
Hide elements in menu. Hide <li> element if a.href = arr[href]
<script>
jQuery(document).ready(function () {
var links = [
'/katalog-produktsii/dekorativnyj-kirpich/belyj',
'/katalog-produktsii/dekorativnyj-kirpich/dlya-vnutrenney-otdelki',
'/katalog-produktsii/dekorativnyj-kirpich/dlya-narujnoy-otdelki',
'/katalog-produktsii/dekorativnyj-kirpich/krasnyj',
'/katalog-produktsii/dikij-kamen/dlya-cokolya',
'/katalog-produktsii/dikij-kamen/dlya-vnutrennej-otdelki',
'/katalog-produktsii/dikij-kamen/dlya-narujney-otdelki',
@Arahort
Arahort / owl-equal-heights.js
Created May 3, 2018 09:54 — forked from agragregra/owl-equal-heights.js
Owl Carousel Equal Heights
onRefresh: function () {
owl.find('div.owl-item').height('');
},
onRefreshed: function () {
owl.find('div.owl-item').height(owl.height());
}