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
<div class="tm-number-input"> | |
<button type="button" class="tm-number-input-minus">–</button> | |
<input type="number" min="1" value="1" class="uk-input"> | |
<button type="button" class="tm-number-input-plus">+</button> | |
</div> |
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 tableSearch(searchId, tableId) { | |
var phrase = document.getElementById(searchId); | |
var table = document.getElementById(tableId); | |
var regPhrase = new RegExp(phrase.value, 'i'); | |
for (var i = 1; i < table.rows.length; i++) { | |
flag = regPhrase.test(table.rows[i].cells[0].innerHTML); | |
if (flag) { | |
table.rows[i].style.display = ''; | |
} else { | |
table.rows[i].style.display = 'none'; |
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 | |
function getInfoBrowser($agent = '') | |
{ | |
if (empty($agent)) { | |
$agent = $_SERVER['HTTP_USER_AGENT']; | |
} | |
$browserInfo = []; | |
$browserInfo['ip'] = $_SERVER['REMOTE_ADDR']; |
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 | |
// === begin: если в $item полей нет === | |
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); | |
$item->jcfields = FieldsHelper::getFields('com_content.article', $item, true); | |
// === end: если в $item полей нет === | |
$fields = []; | |
foreach($item->jcfields as $jcfield) { | |
$fields[$jcfield->name] = $jcfield; |
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 | |
/* | |
Usage | |
$imgIn = str_replace('\\', '/', $imgIn ); | |
$imgOut = str_replace('\\', '/', str_replace(JPATH_ROOT . DIRECTORY_SEPARATOR, '', JPATH_CACHE) . DIRECTORY_SEPARATOR . $imgIn ); | |
if (!file_exists( JPATH_ROOT . DIRECTORY_SEPARATOR . $imgOut )) { | |
getCacheImageSquare($imgIn, $imgOut); | |
} |
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 | |
/* | |
Usage | |
$html = Optimize::html($html); | |
*/ | |
class Optimize | |
{ | |
private static $_html_is_js, $_html_is_css; |
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
.grid { | |
display: grid; | |
grid-gap: 10px; | |
grid-template-columns: repeat(12, 1fr); | |
margin: 0 auto; | |
width: 100%; | |
max-width: 1280px; | |
} | |
.one, .two, .three, .four, .five, .six, .seven, .eight, .nine, .ten, .eleven, .twelve { |
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 | |
function file_size($bytes) | |
{ | |
$sfx = [ 'B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ]; | |
$base = 1024; | |
$class = min((int)log($bytes, $base), count($sfx) - 1); | |
return sprintf('%1.2f' , $bytes / pow($base, $class)) . ' ' . $sfx[$class]; | |
} |
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 | |
function vd(...$args) | |
{ | |
print_r('<pre style="margin:0;padding:20px;font:14px/1.6 Consolas,monospace;' . | |
'background-color:#eee;color:#333">===<br>'); | |
foreach ($args as $i => $context) { | |
if ($i > 0) { | |
print_r('<br>===<br><br>'); | |
} |