Skip to content

Instantly share code, notes, and snippets.

View glebcha's full-sized avatar
👨‍💻
do my best

Gleb glebcha

👨‍💻
do my best
View GitHub Profile
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/query.php
*/
$args = array(
@glebcha
glebcha / gulpfile.js
Last active September 14, 2022 08:39
Gulp task sample (css and js minify+concat, compress images, watching for changes)
// Определяем зависимости в переменных
var gulp = require('gulp'),
cache = require('gulp-cache'),
clean = require('gulp-clean'),
stream = require('event-stream'),
size = require('gulp-size'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),
@glebcha
glebcha / gulpfile.js
Last active July 22, 2020 11:05
Gulp task with Less processing (autoprefixer), live reload (browser-sync), javascript (es6, babelify, react), error handling, images optimization, jade templates
'use strict';
/*
Instructions:
1 - Should execute 'npm run prepare'
before the very first run, it will install and symlink all dependencies.
2 - Choose between production 'npm start' and development 'npm run start-dev' modes
(watcher will run immediately after initial run).
@glebcha
glebcha / curved_polylines.js
Created September 17, 2014 08:01
Google Maps curved polylines
/*
Simple jQuery Curved Line Plugin for use with Google Maps Api
author: Daniel Nanovski
modifications: Coen de Jong
version: 0.0.2 (Beta)
website: http://curved_lines.overfx.net/
License:
@glebcha
glebcha / gulpfile.js
Created November 25, 2014 05:19
Запуск модульных тестов для PHP в Gulp
//Запуск модульных тестов при изменении какого-либо php-файла в проекте
var phpunit = require('gulp-phpunit');
var gulp = require('gulp'),
notify = require('gulp-notify'),
phpunit = require('gulp-phpunit');
gulp.task('phpunit', function() {
var options = {debug: false, notify: true};
@glebcha
glebcha / xmlToJson
Last active August 29, 2015 14:21 — forked from feedmypixel/xmlToJson
/**
* Originally from http://davidwalsh.name/convert-xml-json
* This is a version that provides a JSON object without the attributes and places textNodes as values
* rather than an object with the textNode in it.
* 27/11/2012
* Ben Chidgey
*
* @param xml
* @return {*}
*/
@glebcha
glebcha / iterate_better.js
Created January 13, 2016 18:37
examples of iterators usage
//Iterate through object
const obj = {
foo: 'bar',
comes: 'is',
from: 'object'
};
for(let key in obj) {
if(obj.hasOwnProperty(key)) {
let valueOfKey = obj[key];
console.log('%s: %s', key, valueOfKey);
@glebcha
glebcha / WebstormTweak
Created May 22, 2017 05:04 — forked from abhisheksliam/WebstormTweak
Speed up WebStorm
Here is my recipe how to speed up WebStorm:
Go to Preferences and do next:
Appearance & Behaviour > System Settings > Updates: disable auto update
Appearance & Behaviour > System Settings > Using Statistics: Uncheck allowing sending data
Editor > Live Templates: disable all, leave only what you are really use
Editor > Emmet: disable all emmets
Editor > Intentions: I leave only: CSS, Declaration, JavaScript and Language Injection
Plugins: leave only next (* - can be also disabled in case don't need them):
CoffeeScript *
@glebcha
glebcha / linkedList.js
Last active August 9, 2017 14:59
Linked List
function Node(data) {
this.data = data;
this.next = null;
this.prev = null;
}
function linkedList() {
this.head = null;
this.size = 0;
}
@glebcha
glebcha / quizez.js
Last active January 19, 2018 18:27
Challenges in a hard way
// Find summ of all elements in array => result: 32
var multiArr = [1, '2x', ['3', ['x2', ['10', '10'], '5'], '1x']];
function summ(arr, result) {
var result = result || 0;
for (var i = 0; i < arr.length; i++) {
var number = arr[i];
var notNumber = isNaN(parseInt(number));
var isArray = Object.prototype.toString.call(number) === '[object Array]';