Skip to content

Instantly share code, notes, and snippets.

View levnhub's full-sized avatar
🎯
Focusing

Lev N levnhub

🎯
Focusing
View GitHub Profile
@levnhub
levnhub / tricks.scss
Created October 25, 2017 20:34
SCSS Tricks
// Collect all headers
@for $index from 1 through 6 {
h#{$index} {
margin-top: 0;
}
}
@levnhub
levnhub / gulpfile.js
Created November 7, 2017 22:56
Full Gulpfile
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
cssmin = require('gulp-minify-css'),
imagemin = require('gulp-imagemin'),
@levnhub
levnhub / jquery.snippets.js
Last active January 9, 2018 12:41
jQuery Snippets
// Masked Input
jQuery(function($){
$('input[type="tel"]').mask("+7 (999) 999–99–99");
});
// Fixed Nav
$(window).scroll(function(){
var nav = $('#Nav'),
fix = $('#NavFix'),
scroll = $(window).scrollTop(),
@levnhub
levnhub / php-snippets.php
Last active August 7, 2018 15:41
PHP Snippets
<?php
// Get phone number from ACF & clean for the link
$phone_number = get_field( 'tel', 33 );
$clean_number = str_replace( array(' ', '-', '(', ')'), '', $phone_number );
?>
<a href="tel:<?php echo $clean_number ?>" class="header-menu-tel-link"><?php echo $phone_number ?></a>
<!-- IF -->
<?php
@levnhub
levnhub / wp-config.php
Created December 22, 2017 11:15
WP Config Tweaks
// Increasing the WordPress Memory Limit
define('WP_MEMORY_LIMIT', '64M');
@levnhub
levnhub / dead-center.css
Last active January 29, 2019 14:27
Dead Center Image
// Dead Center Fill
.block {
position: relative;
height: 190px;
overflow: hidden;
.img {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
@levnhub
levnhub / contact.html
Created December 25, 2017 19:13
Contact
// WhatsUp
https://api.whatsapp.com/send?phone=79313311325
// Viber
viber://chat?number=+79999999999
// Telegram
tg://resolve?domain=NAME
@levnhub
levnhub / bootstrap.html
Last active January 15, 2019 14:36
Bootstrap Snippets
<!-- Fixes -->
<style>
// iOS bag fix
.card-header {
cursor: pointer;
}
</style>
<!-- Accordion Menu -->
<ul id="mMenuAccordion" class="mmenu_nav accordion">
@levnhub
levnhub / js.snippets.js
Last active April 26, 2018 15:56
Pure JS Snippets
// Media Queries
function myFunction(x) {
if (x.matches) { // If media query matches
document.body.style.backgroundColor = "yellow";
} else {
document.body.style.backgroundColor = "pink";
}
}
## THIS REMOVES CONTACT FORM 7 BULK FROM EVERY PAGE
## By default, contact form 7 adds the js and css to every page
## in wordpress, which is bulky, so we remove it.
define( 'WPCF7_LOAD_JS', false );
define( 'WPCF7_LOAD_CSS', false );
define( 'WPCF7_AUTOP', false );
/* Это всё, дальше не редактируем. Успехов! */