|
Ok!
|
|
|
Ok!
|
---|---|---|---|---|
121 | img.svg { clip-path: inset(0px 11px 0px 11px); } | clip-path | 3460 | Обрезка картинок |
41 | RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^(?:www.)?(.*)$ [NC] RewriteRule (.*) https://%1%{REQUEST_URI} [L,R=301] | redirect, редирект | 3500 | Редирект с http на https + с www на non-www |
50 | <script> jQuery('.order-form-submit').click(function send_order(){ gtag('event', 'purchase', { "transaction_id": <?=rand(1,1000)?>, "affiliation": "La Maree Buy", "value": {TOVAR_SUM}, "currency": "RUR", "tax": 1.18, "shipping": 350, "items": <?=json_encode( $GLOBALS['item'], JSON_UNESCAPED_UNICODE ); ?> }); }); </script> | gtag, js, аналитика, purchase | 4899 | Скрипт добавки товара в Аналитику gtag js |
32 | function find_closed() { var tr = $('tr'); if($('#searchfield').val() != "") { for (var i = 0; i < tr.length; i++) { if (tr.eq(i).text().toLowerCase().indexOf($('#searchfield').val().toLowerCase()) > -1) { tr.eq(i).addClass('opened'); /*tr.eq(i).css({'background': '#A8E9FF'});*/ var found = 1; }else{ tr.eq(i).removeClass('opened'); } } if (found < 1) { $('.not-found').text('Не найдено') } } } | javascript, поиск в таблице | 5400 | JS функция ищет соответствие в словах скрытых строк таблицы. Если найдет — открывает строку, нет — закрывает |
124 | А я помню вот до сих пор. J3QQ4-H7H2V-2HCH4-M3HK8-6M8VW для меня прям как стих из молодости | виндоус код, windows code | 5600 | Вдруг пригодится |
128 | $current_time = strtotime("now"); $sunrise = strtotime("09:00"); $sunset = strtotime("21:00"); if ($current_time > $sunrise && $current_time < $sunset && date('w') > 0 && date('w') < 6) { ?><a href="https://wa.me/<?=(mob_detect())?"+":""?>74951233121" target="_blank" class="chat_social_item chat_social_wh"></a><? } else { ?><div style="display: none" id="wa_wi" data-info="<?=$current_time . ' ' . $sunrise . ' ' . $sunset?>">С 09:00 до 21:00</div><? } | whatsupp | 5600 | whatsupp widget |
153 | print vsprintf("%04d-%02d-%02d", explode('-', '1988-8-1')); выведет 1988-08-01 | печать даты, php | 5900 | Печать даты в php |
49 | $fp = fopen('tovary.xml',"r"); $arr = file_get_contents('tovary.xml'); $gruops = []; fclose($fp); #[2] => Окрашивание волос #[33] => Перманентная краска $details['category'] = "Перманентная краска"; $s = new SimpleXMLElement($arr); $groups = []; foreach($s->Классификатор->Группы->Группа as $g) { $naim = $g->Наименование; $tid = $g->Ид; $groups[] = [ $tid[0] . "", $naim[0] . "" ]; foreach ( $g->Группы->Группа as $gr_parent ) { $naim = $gr_parent->Наименование; $tid = $gr_parent->Ид; $groups[] = [ $tid[0] . "", $naim[0] . "" ]; } } foreach($groups as $gr){ if($gr[1] == $details['category']){ echo $gr[0]; } } | битрикс, парсинг, xml, товары, каталог | 7090 | Парсить группы (категории) товаров в xml экспорте товаров Битрикс |
86 | RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_HOST} !^www. [NC] RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | https, www | 8700 | Любой редирект на https + www |
232 | if(preg_match('/[A-Z]/', $_SERVER['REQUEST_URI'])){ LocalRedirect(strtolower($_SERVER['REQUEST_URI']), 0, "301 Moved permanently"); } | bitrix, редирект, localredirect | 9000 | Битрикс редирект в обход htaccess с заглавных букв в УРЛ на маленькие |
236 | //ADD SECTION CANONICAL URL $canonicalScheme = CMain::IsHTTPS() ? "https" : "http"; $APPLICATION->AddHeadString('<link rel="canonical" href="' . $canonicalScheme . '://' . SITE_SERVER_NAME . $arCurSection["PATH"][$arCurSection["ID"]]["SECTION_PAGE_URL"] . '" />', true); | bitrix, section | 9008 | ADD SECTION CANONICAL URL |
141 | <?="<p>".implode("<p>", explode("|",$arResult['DETAIL_TEXT']))?> | разбить, explode | 9080 | Если нужно разбить текст по символу и вывести объединенный по другому символу |
231 | $scheme = CMain::IsHTTPS() ? "https" : "http"; | https, bitrix | 9090 | Определить https в Битрикс |
60 | <meta name="viewport" content="width=device-width, initial-scale=1"> | viewport, meta, метатег | 9800 | Метатег viewport |
135 | SELECT * FROM int_posts p, int_postmeta m WHERE p.post_title LIKE '%Чикина%' AND p.post_type = 'page' AND (p.post_status = 'publish' OR p.post_status = 'private') AND p.ID = m.post_id | wp, sql, часть названия | 9800 | SQL запрос WP выборки записи (страницы) по слову из названия |
138 | var dayArr1 = $('.order-form input[name="user_f_9_2"]').val().split('.'); var dFor1 = dayArr1[1] + '-' + dayArr1[0] + '-' + '20' + dayArr1[2]; | covert date, js date | 9800 | Конвертировать дату в яваскрипт формат |
183 | if (mob_detect()) { $APPLICATION->AddHeadString("<style>.wrap center img {margin-bottom: 2em;}</style>"); } | битрикс, header, строка | 9800 | Добавить произвольную строку в заголовок Битрикс |
46 | $filename = 'files/' . $ident . '.xml'; $ctype="application/force-download"; header("Pragma: public"); // required header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); // required for certain browsers header("Content-Type: $ctype"); // change, added quotes to allow spaces in filenames, by Rajkumar Singh header("Content-Disposition: attachment; filename="".basename($filename)."";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($filename)); readfile("$filename"); | download file, php | 10030 | Сформировать файл и передать его на загрузку в браузер |
230 | grep двух слов в строке grep '77.50.63.90' lamaree.ru.access.log | grep '.default/ajax.php' | grep, 2 words | 10080 | Поиск двух слов в строке через grep linux |
266 | /** * Clean Head */ remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'wp_shortlink_wp_head'); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head'); remove_action('wp_head', 'rest_output_link_wp_head', 10); remove_action('wp_head', 'wp_oembed_add_discovery_links', 10); remove_action('wp_head', 'wp_resource_hints', 2); remove_action('template_redirect', 'rest_output_link_header', 11, 0); add_filter('the_generator', '__return_empty_string'); // Убираем версию WordPress remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); // Короткая ссылка, ссылка без ЧПУ <link rel='shortlink' | wp, clean head | 10090 | WP clean header |