Skip to content

Instantly share code, notes, and snippets.

@dkruchok
dkruchok / Ge find me
Created July 3, 2015 06:13
GeoLocation file
$(document).ready(function() {
$("#findme").on("click",function(e) {
e.preventDefault();
if ( !navigator.geolocation ) {
$("#whereami").val("Your browser is also lost, probably because it doesn't support geo-location.");
} else {
$("#findme").animate({
opacity: "0.25"
},"fast");
navigator.geolocation.getCurrentPosition(positionDisplay,showGeoError);
@dkruchok
dkruchok / 0_reuse_code.js
Last active August 29, 2015 14:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dkruchok
dkruchok / CSS IE hacks
Created July 22, 2015 11:17
CSS IE hacks
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10+ specific styles go here */
.map-container svg {
position: static !important;
height: 500px !important;
width: 130% !important;
}
}
/* ie 8.9.10 */
(function($) {
$.fn.animated = function(inEffect, outEffect) {
$(this).css("opacity", "0").addClass("animated").waypoint(function(dir) {
if (dir === "down") {
$(this).removeClass(outEffect).addClass(inEffect).css("opacity", "1");
} else {
$(this).removeClass(inEffect).addClass(outEffect).css("opacity", "1");
};
}, {
offset: "90%"
@dkruchok
dkruchok / WP counter for shortode
Created December 3, 2015 09:23
Counter after p WP
<div class="frame">
<div class="post-content">
<?php if (!is_single() && of_get_option('of_excerptset')=='1') {
$image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<img src="<?php echo $image; ?>">
<?php the_excerpt(); ?>
<?php } else { ?>
<?php //Removed the original line below ?>
<?php //the_content( __('Read more', 'cr') );?>
<?php //Added this one insted: ?>
@dkruchok
dkruchok / gist:3100e94a835e5c7f42d1ae7e990cf030
Created June 13, 2016 11:01
WooCommerce disable/custom croping
add_action( 'after_setup_theme', function () {
// Add image sizes
$shop_thumbnail = wc_get_image_size( 'shop_thumbnail' );
$shop_catalog = wc_get_image_size( 'shop_catalog' );
$shop_single = wc_get_image_size( 'shop_single' );
// In the lines below, true = hard crop; false = proportional