Skip to content

Instantly share code, notes, and snippets.

View ivan-kalachikov's full-sized avatar
:octocat:
falling in love with open source

Ivan Kalachikov ivan-kalachikov

:octocat:
falling in love with open source
View GitHub Profile
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
set -eu
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
snap remove "$snapname" --revision="$revision"
done
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
/* stylelint-disable */
/* Safari 7.1+ */
::-webkit-full-page-media, _:future, :root .parallax-image-block {
background-position: center 0 !important;
background-attachment: scroll;
background-size: cover;
}
/* stylelint-enable */
@ivan-kalachikov
ivan-kalachikov / 1.php
Created April 3, 2020 11:16
php path to theme
<div class="blog-banner" style="background-image: url('<?php echo get_stylesheet_directory_uri () ?>/images/bg-news.jpg')">
@ivan-kalachikov
ivan-kalachikov / 1.js
Last active April 1, 2020 18:04
Serialize and get request
$('.search-product a.btn-submit').click(function (e) {
e.preventDefault();
var data = $(this).closest('form').serialize();
var url = $(this).attr('href');
url = url + '?products-filters&' + data;
window.open(url,"_self")
})
$('.section-product form').change(function () {
var data = $(this).serialize();
@ivan-kalachikov
ivan-kalachikov / 1.js
Created February 13, 2020 07:16
Check element is empty JQuery
if( $.trim( $('.services-section .col:nth-child(2)').text() ) == "" ){
$('.services-section .col:nth-child(2)').parent('.text').addClass('single-col');
};
@ivan-kalachikov
ivan-kalachikov / 1.css
Created February 11, 2020 16:02
gform_ajax_spinner
.gform_ajax_spinner {
position: absolute;
bottom: 45px;
right: 19px;
}
@ivan-kalachikov
ivan-kalachikov / 1.php
Created January 27, 2020 06:09
Fix woo scroll to notice
// Fix woo scroll to notice
add_action(
'get_footer',
static function () {
?>
<script>
jQuery( function( $ ) {
function init() {
if ( typeof $.scroll_to_notices === 'function' ) {
$.scroll_to_notices = function( $scrollElement ) {
<div class="age-confirm-popup popup mfp-hide" data-url="not-allowed.html">
<div class="inner">
<div class="wrap">
<h2 class="title">Are you over age 21?</h2>
<a href="#" class="btn btn-cancel">No</a>
<a href="#" class="btn btn-submit">Yes</a>
</div>
</div>
</div>
@ivan-kalachikov
ivan-kalachikov / init.js
Created October 18, 2019 14:26
Multiple dots Slick
$('.banners').slick({
adaptiveHeight: false,
dots: true,
arrows: false,
autoplay: true,
autoplaySpeed: 6000111,
infinite: true,
appendDots: $('.banner .text')
}).on( 'afterChange', function( event, slick, currentSlide ) {
$.each(slick.$dots, (i, el) => {