Skip to content

Instantly share code, notes, and snippets.

View opyvovarova's full-sized avatar

Olga Pyvovarova opyvovarova

View GitHub Profile
@opyvovarova
opyvovarova / Jquery Resize Height
Created January 3, 2017 19:40
Jquery Resize Height
function heightDetect() {
$(".main_head").css("height", $(window).height());
};
heightDetect();
$(window).resize(function() {
heightDetect();
});
.loader
background: none repeat scroll 0 0 #fff
bottom: 0
height: 100%
left: 0
position: fixed
right: 0
top: 0
width: 100%
z-index: 9999
@opyvovarova
opyvovarova / stretchWP.php
Created January 3, 2017 20:04
The stretch theme WordPress by agragregra
//Подключение библиотек с помощью добаления строчки php-кода
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/main.css">
//Заголовок секции задается через рубрики, а 'menu' - ярлык. Get Category name
<h2><?php
$idObj = get_category_by_slug('menu');
$id = $idObj->term_id;
echo get_cat_name($id);
?></h2>
@opyvovarova
opyvovarova / Gulpfile.js
Last active December 26, 2017 01:21
Gulp
var gulp = require('gulp'), // Подключаем Gulp
sass = require('gulp-sass'), //Подключаем Sass пакет,
browserSync = require('browser-sync'), // Подключаем Browser Sync
concat = require('gulp-concat'), // Подключаем gulp-concat (для конкатенации файлов)
uglify = require('gulp-uglifyjs'), // Подключаем gulp-uglifyjs (для сжатия JS)
cleanCss = require ('gulp-clean-css'),
cssnano = require('gulp-cssnano'), // Подключаем пакет для минификации CSS
rename = require('gulp-rename'), // Подключаем библиотеку для переименования файлов
del = require('del'), // Подключаем библиотеку для удаления файлов и папок
imagemin = require('gulp-imagemin'), // Подключаем библиотеку для работы с изображениями
function heightDetect() {
$(".main_head").css("height", $(window).height());
}
heightDetect();
$(window).resize(function(){
heightDetect();
});
<button class="toggle_mnu">
<div class="sandwich">
<div class="sw-topper"></div>
<div class="sw-bottom"></div>
<div class="sw-footer"></div>
</div>
<button>
$main_color: #222
$w: 28px
@opyvovarova
opyvovarova / query_posts.php
Created March 5, 2017 02:51
Wordpress query_posts
<?php
if(have_posts()) : query_posts('p = 1');
while(have_posts()) : the_post();
?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_thumbnail(array(100, 100)); ?>
<?php endwhile; endif; wp_reset_query(); ?>
@opyvovarova
opyvovarova / index.php
Last active June 2, 2017 07:07
CRUD_PHP_Mysql tutorial
<?php
require_once (__DIR__."/connection.php");
$query = "SELECT * FROM users";
$result = mysqli_query($conn, $query);
?>
<!doctype html>
<html>
<head>
<!-- HTML -->
<a href="#" class="toggle-mnu hidden-lg"><span></span></a>
<!-- SASS -->
.toggle-mnu
display: block
width: 28px
height: 28px
margin-top: 14px
@opyvovarova
opyvovarova / owl-equal-heights.js
Created November 7, 2017 09:51 — forked from agragregra/owl-equal-heights.js
Owl Carousel Equal Heights
onRefresh: function () {
owl.find('div.owl-item').height('');
},
onRefreshed: function () {
owl.find('div.owl-item').height(owl.height());
}