Skip to content

Instantly share code, notes, and snippets.

View Realetive's full-sized avatar

Realetive Realetive

View GitHub Profile
@Realetive
Realetive / install.sh
Created January 5, 2018 01:15
Как установить https://github.com/lyokha/vim-xkbswitch с Раскладкой Бирмана
# 1. Установить xkbswitch
git clone git@github.com:myshov/xkbswitch-macosx.git ~/.vim/plugin/xkbswitch-macosx
ln -s ~/.vim/plugin/xkbswitch-macosx/bin/xkbswitch /usr/local/bin/xkbswitch
# 2. Установить библиотеку-обёртку
git clone git@github.com:myshov/libxkbswitch-macosx.git ~/.vim/plugin/libxkbswitch-macosx
ln -s ~/.vim/plugin/libxkbswitch-macosx/bin/libxkbswitch.dylib /usr/local/lib/libxkbswitch.dylib
console.log('iframeLoader.js');
var thisScript = document.getElementById('artdocWidget');
var parent = thisScript.parentElement;
parent.insertBefore(iframe, thisScript.nextSibling);
@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',
.font {
font-family: -apple-system,
BlinkMacSystemFont,
Segoe UI,
Roboto,
Oxygen,
Ubuntu,
Cantarell,
Fira Sans,
Droid Sans,
@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 [
<?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-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"
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 / 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, ['найдена', 'найдено', 'найдены']);
@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');