Skip to content

Instantly share code, notes, and snippets.

View Realetive's full-sized avatar

Realetive Realetive

View GitHub Profile
<html lang="ru">
<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>Document</title>
<script src="mozgoboj-map.js"></script>
<style>
#google-map {
height: 500px;
@Realetive
Realetive / README.md
Created October 5, 2016 13:01 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@Realetive
Realetive / gulpfile.js
Created November 24, 2016 14:49 — forked from belozer/gulpfile.js
Gulpfile with gulp-bem-presets
const gulp = require('gulp');
const Builder = require('gulp-bem-bundle-builder');
const bundler = require('gulp-bem-bundler-fs');
const nodemon = require('gulp-nodemon');
const merge = require('merge2');
const debug = require('gulp-debug');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const gulpif = require('gulp-if');
const concat = require('gulp-concat');
@Realetive
Realetive / gist:da954c146be8e4da51b4a93c0c8e8be0
Created January 20, 2017 20:09 — forked from realmyst/gist:1262561
Склонение числительных в javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
use:
declOfNum(count, ['найдена', 'найдено', 'найдены']);
console.log('🤙');
myBrowser = function (config) {
config = config || {};
// if (config.length != 0 && config.openTo != undefined) {
// if (!/^\//.test(config.openTo)) {
// config.openTo = '/' + config.openTo;
// }
// if (!/$\//.test(config.openTo)) {
@Realetive
Realetive / post-merge
Created June 21, 2017 14:38 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
<?php
switch ($modx->event->name) {
case "msOnChangeOrderStatus":
// API сервиса смс-рассылок
$url = $modx->getOption("mirSMS__url");
$source = $modx->getOption("mirSMS__source");
$login = $modx->getOption("mirSMS__login");
$password = $modx->getOption("mirSMS__password");
$orderObject = $modx->getObject("msOrder", $order->get( 'id' ) );
@Realetive
Realetive / post.css.js
Last active July 19, 2017 08:12
bem-tools-create template for pobem
'use strict';
var EOL = require('os').EOL;
module.exports = function(entity) {
var elemPart = entity.elem ? ".elem(" + entity.elem + ")" : '',
modVal = entity.modVal || '',
modPart = entity.modName ? ".mod(" + entity.modName + " " + modVal + ")" : '';
return [
.font {
font-family: -apple-system,
BlinkMacSystemFont,
Segoe UI,
Roboto,
Oxygen,
Ubuntu,
Cantarell,
Fira Sans,
Droid Sans,
@Realetive
Realetive / select_type_suggest.bemhtml.js
Created October 10, 2017 05:23
select_type_suggest
block('select').mod('type', 'suggest')(
elem('menu').def()( node => {
return [
node._optionIds.length > 10 ? applyCtx({
elem: 'header',
content: {
block: 'input',
mods: {
type: 'suggest',
width: 'available',