Skip to content

Instantly share code, notes, and snippets.

👔
Notebook ASUS & VSCode 💞

Andrej Sharapov madeas

👔
Notebook ASUS & VSCode 💞
Block or report user

Report or block madeas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@madeas
madeas / gulpfile.js
Last active Jul 18, 2019
Gulp 4 tasks for PUG+SCSS+JS and imagemin
View gulpfile.js
const
gulp = require('gulp'),
pug = require('gulp-pug'),
sourcemaps = require('gulp-sourcemaps'),
concat = require('gulp-concat'),
cleanCSS = require('gulp-clean-css'),
mmq = require('gulp-merge-media-queries'),
babel = require('gulp-babel'),
@madeas
madeas / font-sizes-px.scss
Last active Jul 5, 2019
Sass mixin for the headings: file #1 REM, file #2 PX
View font-sizes-px.scss
$base-font-size: 16px;
$heading-scale: 6;
@for $i from 1 through 6 {
h#{$i} {
font-size: $base-font-size + $heading-scale * (6 - $i);
}
}
// sizes 46px, 40px, 34px, 28px, 22px, 16px
View index.html
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,400,400italic,700,700italics">
@madeas
madeas / feedback.php
Last active Nov 27, 2018
Форма обратной связи html + css + php + jQuery + js
View feedback.php
<?
if ($_POST['who'] == 'robot') {
header('Refresh: 5; URL=https://www.site.ru');
echo ('<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body><h1 style="color:red">Ошибка!</h1>
<p><b>Не отправлено,</b> так как вы являетесь роботом!<br>
Через 5 секунд вы вернетесь на главную страницу.</body></p>');
} elseif ($_POST['mail'] == true) {
View index.html
<!doctype html>
<html lang='ru-RU' itemscope itemtype='http://schema.org/WebPage' prefix='og: http://ogp.me/ns#'>
<!-- <html lang='en-EN' itemscope itemtype='http://schema.org/WebPage' prefix='og: http://ogp.me/ns#'> -->
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1, minimal-ui, shrink-to-fit=no' />
<!-- <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=10.0,minimal-ui"> -->
<meta name='description' content=''>
View robots.txt
User-agent: *
Host: website.ru
Sitemap: https://site.ru/sitemap.xml
View .htaccess
Options All -ExecCGI -Indexes -Includes +FollowSymLinks
DirectoryIndex index.html
AddDefaultCharset utf-8
<IfModule mod_rewrite.c>
RewriteEngine on
# RewriteCond %{HTTPS} !on
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
View canvas.js
// !!! важен порядок положения параметров !!!
// все значения указываются без px
// Задаем стандартные js переменные canvas & element
const
canvas = document.getElementById('canvas'), // получаем указатель на холстрисования
elem = canvas.getContext('2d'); // получаем указатель на контекст
canvas.width = canvas.width; // очищение области - 1 вариант
@madeas
madeas / style.scss
Last active Oct 25, 2018
initial markup
View style.scss
*,
::after,
::before {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
html,
body {
height: 100%;
@madeas
madeas / header.php
Created Sep 20, 2018
for Article! Navbar B-4
View header.php
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarDropdown" aria-controls="navbarDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="<?php echo esc_url( home_url('/') ); ?>"><?php bloginfo('name'); ?></a>
<div class="collapse navbar-collapse" id="navbarDropdown">
<?php
wp_nav_menu( array(
'theme_location' => 'navbar',
'container' => false,
You can’t perform that action at this time.