Skip to content

Instantly share code, notes, and snippets.

View j-tap's full-sized avatar
🍀
Development

Igor j-tap

🍀
Development
View GitHub Profile
console.log('%cError: %O', 'color:red;', error.response)
console.log("%c%s%c%s", "background:#444; color: white; border-radius: 2px 0 0 2px; padding: 3px; font-size: 10px;", "Joe", "background: #1c81c1; color: white; border-radius: 0 2px 2px 0; padding: 3px; font-size: 10px;", "Merk");
var oItems = {};
$('.rubricator').children('.controls').each(function () {
var s = $(this).children('.accordion-link').text();
oItems[s] = Array();
$(this).children('.items').children().each(function () {
oItems[s].push($(this).children('.accordion-link').text());
})
})
var res = JSON.stringify(oItems);
console.log(res);
ol {
list-style: none;
counter-reset: counterItem;
}
ol > li {
counter-increment: counterItem;
}
ol > li::before {
content: counter(counterItem) '. ';
}
@j-tap
j-tap / .htaccess
Last active May 27, 2021 18:52 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
# Redirect for dummi
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/welcome.php$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js)$
RewriteRule .* /welcome.php [L,R=302]
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
div {
position: relative;
width: 100%;
padding-bottom: 56.25%; // 16:9 or 75% to 4:3
}
div iframe {
width: 100%;
height: 100%;
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
@j-tap
j-tap / bitrix date
Last active October 8, 2018 09:22
Bitrix date format example
<time
datetime="<?$datetime = $arItem["DATE_CREATE"]; $arr = ParseDateTime($datetime, FORMAT_DATETIME);
echo $arr["DD"]." ".ToLower(GetMessage("MONTH_".intval($arr["MM"])."_S"))." ".$arr["YYYY"];?>">
<?
$datetime = $arItem["DATE_CREATE"];
$arr = ParseDateTime($datetime, FORMAT_DATETIME);
echo "<span>".$arr["DD"]."</span>"."<span>".ToLower(GetMessage("MONTH_".intval($arr["MM"])."_S"))."</span>"."<span>".$arr["YYYY"]."</span>";
?>
</time>
$('form input').tooltip({
trigger: 'manual',
placement: 'bottom',
container: 'body'
}).on('shown.bs.tooltip', function (e) {
$(e.target).on('focus', function () {
$(e.target).tooltip('hide');
})
/*setTimeout(function () {
$(e.target).tooltip('hide');//.removeAttr('data-original-title');
@j-tap
j-tap / Loading
Created September 20, 2017 17:11
js and css
.overlay-loading {
position: absolute;
background: rgba(255, 255, 255, 0.59);
z-index: 99999999;
}
.overlay-loading:before {
content: '\21BB';
position: absolute;
top: 50%;
left: 50%;
@j-tap
j-tap / html - reverse columns
Created June 13, 2017 13:30
bootstrap 4 invert columns responsive
<div class="row flex-row-reverse">
<div class="col-md-6 first">
<img src="http://placehold.it/350x150?text=first">
</div>
<div class="col-md-6 second">
<img src="http://placehold.it/350x150?text=second">
</div>
</div>
@j-tap
j-tap / html - picture
Last active June 9, 2017 13:31
img for multiple images on responsive
<picture>
<source media="(min-width: 992px)" srcset="upload/header-bg.jpg">
<img src="upload/header-bg-sm.jpg">
</picture>