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
license: apache-2.0 |
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 cadastrePattern = new RegExp('\\d{1,2}:\\d{1,2}:\\d{6,7}:\\d{1,4}', 'gm'); | |
console.log('89:08:1111111:1'.match(cadastrePattern)) |
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
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
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 declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); | |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |
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 | |
$to = "[email protected]"; // адрес куда отправлять письмо | |
$subject = "Отправка формы с сайта"; // заголовок письма | |
$_POST = json_decode(file_get_contents('php://input'), true); | |
foreach($_POST as $key => $value) | |
{ $fields .= $key.": ".$value." \r\n"; } | |
$message = $subject." \r\n".$fields; | |
$headers = "Content-type: text/plain; charset=utf-8 \r\n"; |
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
{ | |
"Алтайский край": { | |
"0": [ | |
[ | |
54.469437, | |
85.079468 | |
], | |
[ | |
54.195824, | |
85.44720500000001 |
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
Найдите уникальные id's в массиве. | |
arr.filter((v,i,a)=>a.findIndex(t=>(t.id === v.id))===i) | |
Уникальный по нескольким свойствам ( place и name ) | |
arr.filter((v,i,a)=>a.findIndex(t=>(t.place === v.place && t.name===v.name))===i) | |
Уникальный по всем свойствам (это будет медленно для больших массивов) | |
arr.filter((v,i,a)=>a.findIndex(t=>(JSON.stringify(t) === JSON.stringify(v)))===i) | |
Сохраните последнее событие. |
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
/** | |
* Loading Animation Snippet | |
*/ | |
.loading { | |
color: transparent; | |
background: linear-gradient(100deg, #eceff1 30%, #f6f7f8 50%, #eceff1 70%); | |
background-size: 400%; | |
animation: loading 1.2s ease-in-out infinite; | |
} |