Skip to content

Instantly share code, notes, and snippets.

View buriato's full-sized avatar

buriato buriato

  • Russia
View GitHub Profile
@buriato
buriato / index.pug
Created June 30, 2018 11:23
pug template
doctype html
html(lang="en")
head
meta(charset="UTF-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(http-equiv="X-UA-Compatible", content="ie=edge")
title Webpack app
body
h1 test pug
@buriato
buriato / parallax.js
Last active September 9, 2017 03:35
Parallax on mouse move
var parallaxContainer = document.getElementById('parallax'),
layers = parallaxContainer.children;
var moveLayers = function (e) {
var initialX = (window.innerWidth / 2) - e.pageX,
initialY = (window.innerHeight / 2) - e.pageY;
[].slice.call(layers).forEach(function (layer, i) {
var divider = i / 100,
@buriato
buriato / button.sass
Created August 15, 2017 00:32 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600
@buriato
buriato / animate-css.js
Created March 11, 2017 23:47
animate.css for waypointjs from webdesign master
//Animate CSS + WayPoints javaScript Plugin
//Example: $(".element").animated("zoomInUp", "zoomOutDown");
//Author URL: http://webdesign-master.ru
(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");
@buriato
buriato / bootstrap-sass-mixin-cheatsheet.scss
Created March 7, 2017 04:08
Bootstrap mixins sass grid
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@buriato
buriato / file.php
Created February 24, 2017 04:31
WordPress Get Category name By label
<?php
$idObj = get_category_by_slug('s_about');
$id = $idObj->term_id;
echo get_cat_name($id);
?>
@buriato
buriato / Wordpress get tags
Created February 24, 2017 03:58
Wordpress get tags functions
<?php
$tags = get_tags();
if ($tags) {
foreach ($tags as $tag) {
echo '<p>Tag: <a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> </p> ';
}
}
?>
<?php
$tags = wp_get_post_tags($post->ID);
@buriato
buriato / WordPress Get Custom Field
Created February 24, 2017 01:29
WordPress Get Custom Field
<?php echo get_post_meta($post->ID, 'year', true); ?>
@buriato
buriato / wp_get_attachment_image_src
Last active February 24, 2017 00:30
function to get link to the big image (for example using in popup scripts)
<?php if ( has_post_thumbnail() ) : ?>
<a class="popup" href="<?php echo wp_get_attachment_image_src(get_post_thumbnail_id(),'large')[0];
?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(array(260,260)); ?>
</a>
<?php endif; ?>
show_admin_bar(false);
add_theme_support('post-thumbnails');
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'rsd_link' );
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'wp_generator');