Skip to content

Instantly share code, notes, and snippets.


Mikhail MikhailRoot

View GitHub Profile
MikhailRoot / MyPluginUpdater.php
Created Aug 9, 2017
Example of how to use plugin-update-checker to check for updates multiple plugins and enable automatic background updates if needed.
View MyPluginUpdater.php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
require_once __DIR__. '/plugin-update-checker-4.2/plugin-update-checker.php';
class MyPluginUpdater {
View laravel-5.3-elixir-nghtml2js-extension.js
const elixir = require('laravel-elixir');
elixir.extend('nghtml2js', function(sources,moduleName,prefix,destFolder,destfileName) {
const ngHtml2Js = require("gulp-ng-html2js");
const htmlmin = require('gulp-htmlmin');
const concat = require("gulp-concat");
const uglify = require("gulp-uglify");
new elixir.Task('nghtml2js',function(){
MikhailRoot / toParam.js
Created Oct 29, 2016
AngularJS $http service tuning for Wordpress
View toParam.js
* Created by Mikhail.root on 22.02.2016. originaly from
* Fixed encoding of JS Date objects
(function () {
'use strict';
angular.extend(angular, {toParam: toParam})
.module('YourAppModuleNameHere') // set it to your app module name!
.config(['$httpProvider',function ($httpProvider) {
$['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8';
View find-overflow-elements.js
// originaly based on code from
// improved to handle absolute positioned elements shifted to right making overflow happend.
function findOverflow(){
var docWidth = document.documentElement.offsetWidth;
function(el) {
var rect= el.getBoundingClientRect();
if (el.offsetWidth > docWidth ||rect.right>docWidth) {