Skip to content

Instantly share code, notes, and snippets.

View asistent0's full-sized avatar

Константин asistent0

  • Volzhsky
  • 01:11 (UTC +03:00)
View GitHub Profile
@asistent0
asistent0 / Preferences.sublime-settings
Last active November 19, 2016 17:03
Пользовательские настройки Sublime Text 3
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"build_on_save": 1,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_style": "phase",
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Ocean.tmTheme",
"enabled_plugins":
[
@asistent0
asistent0 / comands
Last active August 3, 2025 12:35
Команды для npm и cmd
{
Сокращения: {
install: (i),
uninstall: (r),
update: (up),
--save: (-S),
--save-dev: (-D),
--global: (-g)
},
npm: {
@asistent0
asistent0 / footer.css
Created August 18, 2016 17:12
CSS: footer down
.clearfix:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
@asistent0
asistent0 / gulpfile.js
Last active November 15, 2016 05:11 — forked from Insayt/gulpfile.js
'use strict';
var gulp = require('gulp'),
watch = require('gulp-watch'),
prefixer = require('gulp-autoprefixer'),
uglify = require('gulp-uglify'),
sass = require('gulp-sass'),
sourcemaps = require('gulp-sourcemaps'),
rigger = require('gulp-rigger'),
cssmin = require('gulp-minify-css'),
@asistent0
asistent0 / Package Control.json
Created November 19, 2016 17:01
installed package sublime text 3
{
"installed_packages":
[
"Alignment",
"All Autocomplete",
"AutoFileName",
"Bootstrap 3 Snippets",
"Boxy Theme",
"BracketHighlighter",
"Can I Use",
@asistent0
asistent0 / object-fit-contain.css
Last active August 16, 2018 19:03
Заменить cross-brauser-ным решением свойство object-fit: contain или использовать js //https://cdnjs.cloudflare.com/ajax/libs/object-fit-images/3.2.3/ofi.min.js objectFitImages(); // IE & Edge 12-15 don't support object-fit
.wrap_img {
position: absolute;
overflow: hidden;
width: 22px;
height: 22px;
}
.wrap_img img {
display: block;
max-width: 100%;
max-height: 100%;
@asistent0
asistent0 / object-fit-cover.css
Last active August 16, 2018 19:02
Заменить cross-brauser-ным решением свойство object-fit: cover From https://codepen.io/studiotwist/pen/XdgqmZ или использовать js //https://cdnjs.cloudflare.com/ajax/libs/object-fit-images/3.2.3/ofi.min.js objectFitImages(); // IE & Edge 12-15 don'
.imagecontainer{
position: relative;
overflow: hidden;
width: 20rem;
height: 20rem;
}
.imagecontainer img{
position: absolute;
top: -9999px;
@asistent0
asistent0 / scrollBlock.js
Created August 19, 2017 16:26
Плагин сроллинга блока при прокрутке страницы, пример вызова: $('#scroll_block').scrollBlock({ options }); в options задаются: wrapElem - id или class внешнего элемента; topElem, bottomElem - если вверху или внизу подвижного блока внутри общего внешнего элемента есть дополнительные блоки; minWidthWindows - если сайт резиновый, то можно задать ми…
(function( $ ) {
$.fn.scrollBlock = function( options ) {
var settings = $.extend( {
'wrapElem' : '.content', // class или id внешнего элемента например '.class' или '#id'
'topElem' : '', // class или id верхнего дополнительного элемента например '.class' или '#id'
'bottomElem' : '', // class или id эелемента нижнего дополнительного элемента например '.class' или '#id'
'minWidthWindows' : 0, // мимимальная ширина при которой нужно отключать подвижность блока
'paddingBefore' : 0, // дополнительное расстояние отступ от верха страницы при движении
'paddingAfter' : 0, // дополнительное расстояние отступ от футера когда элемент дойдет до него
@asistent0
asistent0 / getProtocol.php
Created August 19, 2017 16:26
Функция для определения протокола сайта
function getProtocol() {
if (isset($_SERVER['HTTPS']) &&
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$protocol = 'https';
}
else {
$protocol = 'http';
}