Skip to content

Instantly share code, notes, and snippets.

View Woorg's full-sized avatar

Igor Gorlov Woorg

View GitHub Profile
//***************** СЧЕТЧИК КОЛИЧЕСТВА ТОВАРА (КОРЗИНА) *******************//
$('.minus').click(function () {
var $input = $(this).parent().find('input');
var count = parseInt($input.val()) - 1;
count = count < 1 ? 1 : count;
$input.val(count);
$input.change();
return false;
});
$('.plus').click(function () {
// triangle
@mixin triangle($direction, $size: 6px, $color: #222){
content: '';
display: block;
position: absolute;
height: 0; width: 0;
@if ($direction == 'up'){
border-bottom: $size solid $color;
border-left: 1/2*$size solid transparent;
<?php
- $args = array('post_type' => 'products', 'post_status' => 'draft', 'numberposts' => 4000)
- $posts = get_posts($args)
//- = var_dump($posts)
- if(is_array($posts)) :
- foreach( $posts as $post ) :
- wp_delete_post( $post->ID, false )
ol
li!= 'Deleted Post:' . $post->title . "\r\n"
- endforeach;
@Woorg
Woorg / gist:bb9a79cf0c538a7547d2
Last active March 29, 2016 16:40
download entire site and convert paths to local
wget -r -p -k -l 0 -e robots=off --referer="http://www.google.com" http://mokselle-dev.ru/
@Woorg
Woorg / Package%20Control.sublime-settings
Last active December 29, 2015 02:45
Sublime settings
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"Package Control",
"Sync Settings"
]
@Woorg
Woorg / animate on click
Last active December 4, 2015 16:56
animate to element on click
$('a[href*=#]').click(function(){
var elementClick = $(this).attr("href")
var destination = $(elementClick).offset().top;
console.log(destination);
jQuery("html:not(:animated),body:not(:animated)").animate({scrollTop: destination}, 1000);
return false;
});
(function( $ ) {
// First, we have to force the size of the map in order to determine the results
$(function() {
if ( 768 > $( window ).width() ) {
$( '#map-canvas' )
.height( 100 )
.width( '100%' )
//
// TRACKING
// ========
//
tracking($val, $base = false)
if $base
( ( $val * $base ) / 1000 ) px
else
font-bold(fs, lh)
font normal fs / lh 'open_sansbold', sans-serif
font-regular(fs, lh)
font normal fs / lh 'open_sansregular', sans-serif
font-semibold(fs, lh)
font normal fs / lh 'open_sanssemibold', sans-serif
font-light(fs, lh)
font normal fs / lh 'open_sanslight', sans-serif
anim($('#footer_logo'));
function anim(block) {
block.hover( function() { trig=1; repeat(); }, function() { trig=0; } );
var trig = 0;
function repeat() {
if (trig)
block.animate({backgroundColor: $.Color(block.css('backgroundColor')).hue('+=6')}, 30, repeat);
}
}