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 | |
| /** | |
| * Простой прокси-сервер на PHP для изучения и модификации данных, | |
| * передаваемых между браузером и сторонним сервером. | |
| * | |
| * Запуск: | |
| * | |
| * указать URL сайта в $base | |
| * php -S 127.0.0.1:9001 proxy.php | |
| * |
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 | |
| $str = 'fD3_'; | |
| $chars = array_merge(range('a', 'z'), range('A', 'Z'), range('0', '9'), ['_']); | |
| $total = 0; | |
| $brut = ''; | |
| $len = strlen($str); | |
| /** | |
| * @see: https://www.programmingalgorithms.com/algorithm/brute-force?lang=PHP | |
| */ |
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
| // vanilla JS window width and height | |
| var w=window, | |
| d=document, | |
| e=d.documentElement, | |
| g=d.getElementsByTagName('body')[0], | |
| x=w.innerWidth||e.clientWidth||g.clientWidth, | |
| y=w.innerHeight||e.clientHeight||g.clientHeight; |
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 | |
| $id = $modx->resource->id; | |
| $tpls = explode(',', $modx->getOption('minishop.goods_tpl')); | |
| if (!isset($limit)) {$limit = 10;} | |
| if (!isset($tpl)) {$tpl = 'tpl.msGoods.row';} | |
| // Вносим ID просмотренных товаров | |
| if (in_array($modx->resource->template, $tpls)) { | |
| if (!isset($_SESSION['viewed'])) { |
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 | |
| // https://github.com/morfah/MorfMedia/blob/master/validate.php | |
| function valid($str, $minln, $validlength) { | |
| $validmask="abcdefghijklmnopqrstuvwxyz0123456789_- "; | |
| $str=strtolower($str); | |
| if (strspn($str, $validmask) == strlen($str) && $validlength >= strlen($str) && $minln <= strlen($str)) | |
| return true; | |
| else | |
| return false; |
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 () { | |
| //grab the entire query string | |
| var query = document.location.search.replace('?', ''); | |
| //extract each field/value pair | |
| query = query.split('&'); | |
| //run through each pair | |
| for (var i = 0; i < query.length; i++) { | |
| //split up the field/value pair into an array | |
| var field = query[i].split("="); | |
| //target the field and assign its value |
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 | |
| /* | |
| echo plural_form(42, array('арбуз', 'арбуза', 'арбузов')); | |
| */ | |
| function plural_form($n, $forms) { | |
| return $n%10==1&&$n%100!=11?$forms[0]:($n%10>=2&&$n%10<=4&&($n%100<10||$n%100>=20)?$forms[1]:$forms[2]); | |
| } |
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
| $(".element").waypoint(function() { | |
| $(this).addClass("animated zoomInUp"); | |
| }, { | |
| offset: "70%" | |
| }); | |
| .element:nth-child(1) { | |
| -webkit-animation-delay: 0s; | |
| -o-animation-delay: 0s; | |
| animation-delay: 0s; |
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
| //Easy Form Validator | |
| //Example: $("form").evalid("Error message"); | |
| //Author URL: http://webdesign-master.ru | |
| (function($) { | |
| $.fn.evalid = function(req_text) { | |
| $(this).find("input[type], textarea").each(function() { | |
| $(this).after("<p class='form_error_message'>" + req_text + "").next().hide(); | |
| }); |
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
| //Цели для Яндекс.Метрики и Google Analytics | |
| $(".count_element").on("click", (function() { | |
| ga("send", "event", "goal", "goal"); | |
| yaCounterXXXXXXXX.reachGoal("goal"); | |
| return true; | |
| })); |
NewerOlder