Skip to content

Instantly share code, notes, and snippets.

View alekskravchenko's full-sized avatar

Aleksandr Kravchenko alekskravchenko

View GitHub Profile
@alekskravchenko
alekskravchenko / howto.md
Created March 3, 2022 20:11 — forked from MrCoker/howto.md
Import Database into MAMP using terminal
@alekskravchenko
alekskravchenko / README.md
Created April 6, 2019 20:37 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
<div class="social-share">
<span>Share article</span>
<div class="social">
<a class="social-item social-item--facebook" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"></a>
<?php $pin_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID)); ?>
<a class="social-item social-item--pinterest" data-pin-do="skipLink" target="_blank" href="https://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php echo $pin_image; ?>&description=<?php the_title(); ?>"></a>
<a class="social-item social-item--twitter" target="_blank" href="https://twitter.com/home?status=Check%20out%20this%20article:%20<?php print social_title( get_the_title() ); ?>%20-%20<?php echo urlencode(the_permalink()); ?>"></a>
<a class="social-item social-item--gplus" target="_blank" href="https://plus.google.com/share?url=<?php the_permalink(); ?>"></a>
<a class="social-item social-item--mail" href="mailto:?subject=<?php the_title();?>&amp;body=<?php the_permalink()
@alekskravchenko
alekskravchenko / page-blog.php
Last active August 24, 2017 08:12
custom blog page
<?php get_header(); ?>
<div class="main-container">
<div id="content">
<div id="main">
<?php query_posts('post_type=post&post_status=publish&posts_per_page=5&paged='. get_query_var('paged')); ?>
@alekskravchenko
alekskravchenko / skip-to-check-out.php
Created August 8, 2017 17:16 — forked from micc83/skip-to-check-out.php
Skip cart and redirect to direct checkout on WooCommerce
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart
// Get The Page ID You Need
get_option( 'woocommerce_shop_page_id' );
get_option( 'woocommerce_cart_page_id' );
get_option( 'woocommerce_checkout_page_id' );
get_option( 'woocommerce_pay_page_id' );
get_option( 'woocommerce_thanks_page_id' );
get_option( 'woocommerce_myaccount_page_id' );
get_option( 'woocommerce_edit_address_page_id' );
get_option( 'woocommerce_view_order_page_id' );
get_option( 'woocommerce_terms_page_id' );
var wordRotateIndex = 0;
function wordRotate() {
var i;
var x = document.getElementsByClassName("rotating-word");
for (i = 0; i < x.length; i++) {
$(x[i]).hide();
}
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group functions
////
/// Creates a CSS triangle, which can be used for dropdown arrows, dropdown pips, and more. Use this mixin inside a `&::before` or `&::after` selector, to attach the triangle to an existing element.
///
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {