Skip to content

Instantly share code, notes, and snippets.

View DragorWW's full-sized avatar

Andreev Sergey DragorWW

View GitHub Profile
@DragorWW
DragorWW / function.php
Created May 19, 2014 04:59
Add custom tyneMCE style in wordpress
// TyneMCE options :
// - editor style
function add_editor_styles() {
add_editor_style( 'css/editor-style.css' );
}
add_action( 'init', 'add_editor_styles' );
// - add custom style
add_filter( 'mce_buttons_2', 'mce_editor_buttons' );
function mce_editor_buttons( $buttons ) {
@DragorWW
DragorWW / no-select-text.css
Created May 19, 2014 09:28
disable select text css
.no-select-text {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@DragorWW
DragorWW / template.js
Last active August 29, 2015 14:02
Template.JS - template engine
/**
* Template.JS v 0.1
* @author Andreev Sergey
* @corp USERSTORY
*/
(function($) {
/**
* Template engine class
* @param {string} tpl template name
* @param {array} o @optional options array
@DragorWW
DragorWW / no-phone-style
Created September 23, 2014 13:35
Remove mobile safari phone css style
<meta name="format-detection" content="telephone=no">
@DragorWW
DragorWW / gist:33b7284fde65b91cd44e
Created October 7, 2015 05:03 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@DragorWW
DragorWW / .csscomb.json
Last active December 23, 2015 07:13
Csscomb
{
"remove-empty-rulesets": true,
"always-semicolon": true,
"color-case": "lower",
"block-indent": " ",
"color-shorthand": true,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
@DragorWW
DragorWW / list-cd
Last active January 3, 2016 21:18
comma, comma, dot. list
.list-cd {margin-right: 0,5em;}
.list-cd::after {content: ', '; position: absolute;}
.list-cd:after {content: '.';}
@DragorWW
DragorWW / no-event
Last active January 3, 2016 23:29
disable event for dom element (event proxy)
.no-event {
pointer-events: none; // IE9, IE10, webkit, fireFox
}
@DragorWW
DragorWW / jq-event-return-false
Created January 21, 2014 09:24
jquery event return false
$('.elm').click(function(e) {
e.preventDefault();
e.stopPropagation(); // stop other event for this elm
});
(function($){
var hasTouch = /android|iphone|ipad/i.test(navigator.userAgent.toLowerCase()),
eventName = hasTouch ? 'touchend' : 'click';
/**
* Bind an event handler to the "double tap" JavaScript event.
* @param {function} doubleTapHandler
* @param {number} [delay=300]
*/