|
Ok!
|
|
|
Ok!
|
---|---|---|---|---|
29 | @media all and (min-width: 1001px) { #sidebar ul li a:after { content: " (" attr(data-email) ")"; font-size: 11px; font-style: italic; color: #666; } } | media, content | 0 | Текст тега из атрибуте data-* |
28 | function mail_utf8($to, $from_user, $from_email, $subject = '(No subject)', $message = '') { $from_user = "=?UTF-8?B?".base64_encode($from_user)."?="; $subject = "=?UTF-8?B?".base64_encode($subject)."?="; $headers = "From: $from_user <$from_email> ". "MIME-Version: 1.0" . " " . "Content-type: text/plain; charset=UTF-8" . " "; return mail($to, $subject, $message, $headers); } | utf-8, mail, php | 90 | Функция mail utf-8 |
27 | <?php function Escape_win ($path) { $path = strtoupper ($path); return strtr($path, array("U0430"=>"а", "U0431"=>"б", "U0432"=>"в", "U0433"=>"г", "U0434"=>"д", "U0435"=>"е", "U0451"=>"ё", "U0436"=>"ж", "U0437"=>"з", "U0438"=>"и", "U0439"=>"й", "U043A"=>"к", "U043B"=>"л", "U043C"=>"м", "U043D"=>"н", "U043E"=>"о", "U043F"=>"п", "U0440"=>"р", "U0441"=>"с", "U0442"=>"т", "U0443"=>"у", "U0444"=>"ф", "U0445"=>"х", "U0446"=>"ц", "U0447"=>"ч", "U0448"=>"ш", "U0449"=>"щ", "U044A"=>"ъ", "U044B"=>"ы", "U044C"=>"ь", "U044D"=>"э", "U044E"=>"ю", "U044F"=>"я", "U0410"=>"А", "U0411"=>"Б", "U0412"=>"В", "U0413"=>"Г", "U0414"=>"Д", "U0415"=>"Е", "U0401"=>"Ё", "U0416"=>"Ж", "U0417"=>"З", "U0418"=>"И", "U0419"=>"Й", "U041A"=>"К", "U041B"=>"Л", "U041C"=>"М", "U041D"=>"Н", "U041E"=>"О", "U041F"=>"П", "U0420"=>"Р", "U0421"=>"С", "U0422"=>"Т", "U0423"=>"У", "U0424"=>"Ф", "U0425"=>"Х", "U0426"=>"Ц", "U0427"=>"Ч", "U0428"=>"Ш", "U0429"=>"Щ", "U042A"=>"Ъ", "U042B"=>"Ы", "U042C"=>"Ь", "U042D"=>"Э", "U042E"=>"Ю", "U042F"=>"Я")); } $str = "u0430u043fu044bu0443u043au0435u043f "; print Escape_win ($str); ?> | json, decode | 1030 | Преобразовать в русскоязычные символы |
26 | <!--script src="http://maps.api.2gis.ru/2.0/loader.js?pkg=full"></script--> <!--script type="text/javascript"> var map; DG.then(function () { map = DG.map('map', { center: [55.753276, 37.783386], zoom: 15 }); myIcon = DG.icon({ iconUrl: '/wp-content/uploads/2016/12/berkana-marker.png', iconSize: [43, 50] }); DG.marker([55.754244, 37.778933], {icon: myIcon}).addTo(map) }); </script--> | карта, 2gis, скрипт | 1800 | Карта 2Gis |
25 | SELECT CONVERT(CONVERT(message USING BINARY) USING cp1251) AS cp1251, CONVERT(CONVERT(message USING BINARY) USING utf8) AS utf8 FROM b_event_message bem WHERE CONVERT(message USING BINARY) RLIKE CONCAT('[', UNHEX('80'), '-', UNHEX('FF'), ']') | sql, script, detect wrong encoding | 506 | Обнаружить не так кодированную ячейку в таблице mysql |
24 | $rs_Section = CIBlockSection::GetList( array('DEPTH_LEVEL' => 'desc'), $ar_Filter, false, array('ID', 'NAME', 'IBLOCK_SECTION_ID', 'DEPTH_LEVEL', 'SORT') ); $ar_SectionList = array(); $ar_DepthLavel = array(); while($ar_Section = $rs_Section->GetNext(true, false)) { $ar_SectionList[$ar_Section['ID']] = $ar_Section; $ar_DepthLavel[] = $ar_Section['DEPTH_LEVEL']; } $ar_DepthLavelResult = array_unique($ar_DepthLavel); rsort($ar_DepthLavelResult); $i_MaxDepthLevel = $ar_DepthLavelResult[0]; for( $i = $i_MaxDepthLevel; $i > 1; $i-- ) { foreach ( $ar_SectionList as $i_SectionID => $ar_Value ) { if( $ar_Value['DEPTH_LEVEL'] == $i ) { $ar_SectionList[$ar_Value['IBLOCK_SECTION_ID']]['SUB_SECTION'][] = $ar_Value; unset( $ar_SectionList[$i_SectionID] ); } } } function __sectionSort($a, $b) { if ($a['SORT'] == $b['SORT']) { return 0; } return ($a['SORT'] < $b['SORT']) ? -1 : 1; } usort($ar_SectionList, "__sectionSort"); | битрикс, массив, перебор | 0 | Перебор массива Битрикс в виде дерева |
23 | $mySignatureValue = md5("$nOutSum:$nInvId:$mrh_pass1:shpdate=$shpdate:shpphone=$shpphone:shppin=$shppin:shptime=$shptime"); | signature value, robokassa | 0 | Строка signature value для платежей через Робокассу |
22 | // Create an iframe: const iframe = document.createElement('iframe'); // Put it in the document (but hidden): iframe.style.display = 'none'; document.body.appendChild(iframe); // Wait for the iframe to be ready: iframe.onload = () => { // Ignore further load events: iframe.onload = null; // Write a dummy tag: iframe.contentDocument.write('<streaming-element>'); // Get a reference to that element: const streamingElement = iframe.contentDocument.querySelector('streaming-element'); // Pull it out of the iframe & into the parent document: document.body.appendChild(streamingElement); // Write some more content - this should be done async: iframe.contentDocument.write('<p>Hello!</p>'); // Keep writing content like above, and then when we're done: iframe.contentDocument.write('</streaming-element>'); iframe.contentDocument.close(); }; // Initialise the iframe iframe.src = ''; | iframe vs link | 1755 | Возможный способ ускорения загрузки через Javascript |
21 | <img src="http://bit.ly/2heoc2H" alt="Simon's cat" width="200" height="200"> img { object-fit: cover; // magic goes here } | картинка, по ширине, по высоте, подогнать картинку, вместо background-size, object-fit | 190 | Решение с изображением, чтобы отображалось без сжатия и не бэкграунд |
20 | :root { font-size: calc(1vw + 1vh + .5vmin); } Now you can utilize the root em unit based on the value calculated by :root: body { font: 1rem/1.6 sans-serif; } | css, шрифт, адаптивно | 20 | Установка размера шрифта в CSS адаптивно изменяющегося к любой ширине экрана |