Skip to content

Instantly share code, notes, and snippets.

View cheh's full-sized avatar

Dima Chekhovskyi cheh

View GitHub Profile
@cheh
cheh / gist:3852278
Last active October 3, 2019 15:39 — forked from ramzesimus/gist:3808207
CSS: Hide Text
.hide-text {
font: 0/0 a;
text-shadow: none;
color: transparent;
border: 0;
background-color: transparent;
}
@cheh
cheh / font-family
Created October 25, 2012 08:04
CSS: Standard font-family set
font-family:Verdana, Geneva, sans-serif;
font-family:Georgia, "Times New Roman", Times, serif;
font-family:"Courier New", Courier, monospace;
font-family:Arial, Helvetica, sans-serif;
font-family:Tahoma, Geneva, sans-serif;
font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
font-family:"Arial Black", Gadget, sans-serif;
font-family:"Times New Roman", Times, serif;
font-family:"Palatino Linotype", "Book Antiqua", Palatino, serif;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
@cheh
cheh / media-queries
Created October 26, 2012 07:36
CSS: Media Queries
/* Large desktop */
@media (min-width: 1200px) { ... }
/* Portrait tablet to landscape and desktop */
@media (min-width: 768px) and (max-width: 979px) { ... }
/* Landscape phone to portrait tablet */
@media (max-width: 767px) { ... }
/* Landscape phones and down */
@cheh
cheh / gist:5005017
Last active December 14, 2015 01:19
CSS: Gray Filter for All
.thumb {
-webkit-filter: grayscale(100%); // Chrome
filter: url("data:image/svg+xml;utf8,<svg%20xmlns='http://www.w3.org/2000/svg'><filter%20id='grayscale'><feColorMatrix%20type='matrix'%20values='0.3333%200.3333%200.3333%200%200%200.3333%200.3333%200.3333%200%200%200.3333%200.3333%200.3333%200%200%200%200%200%201%200'/></filter></svg>#grayscale"); // Firefox
&:hover {
-webkit-filter: grayscale(0%);
filter: none;
img {
filter: none;
}
}
@cheh
cheh / gist:6029153
Last active December 19, 2015 22:39
WP: Using get_template_part within Shortcodes
function my_ads_shortcode( $attr ) {
ob_start();
get_template_part( 'ads' );
return ob_get_clean();
}
add_shortcode( 'ads', 'my_ads_shortcode' );
@cheh
cheh / gist:6029161
Last active December 19, 2015 22:39 — forked from ramzesimus/gist:3956244
CSS: Text Gradient + Text Shadow
.title {
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #9bc7e2), color-stop(100%, #9bc7e2));
background-image: -webkit-linear-gradient(#ffffff,#9bc7e2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: #fff;
position: relative;
text-shadow: none;
}
.title:before {
@cheh
cheh / gist:6073652
Last active May 30, 2018 12:04
git: main command
Правка последнего коммита
git commit --amend -m "Add comment"
======================================
Лог
git log --all --pretty=format:'%h %cd %s (%an)' --since='7 days ago'
======================================
Откат до определенного коммита
git reset --hard sha_commit_code
@cheh
cheh / wp-query-ref.php
Last active December 20, 2015 17:49 — forked from luetkemj/wp-query-ref.php
WP: WP_Query
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
@cheh
cheh / wp-config.php
Last active January 1, 2016 10:29
WP: Debugging
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'SAVEQUERIES', true );
define( 'SCRIPT_DEBUG', true );
//define( 'DISABLE_WP_CRON', true );
define( 'CONCATENATE_SCRIPTS', false );
// Write to the log file.
error_log( var_export( $foo, true ) );
@cheh
cheh / cols-width.less
Created January 17, 2014 20:35
Calc width for column
// var
@margin : 2%;
// mixin
.colsWidth(@margin, @num_cols : 1) {
width: ( 100 - @margin * ( @num_cols - 1 ) ) / @num_cols;
}
// style.less
.price-cols-2 .col { .colsWidth(@margin, 2); }