Skip to content

Instantly share code, notes, and snippets.

View z4o4z's full-sized avatar
💻

Evgeny Zaytsev z4o4z

💻
  • Voiceflow
  • Poland
  • 17:29 (UTC +02:00)
View GitHub Profile
@z4o4z
z4o4z / doubleNum
Last active January 28, 2016 19:02
function doubleNum (number) {
var string = number.toString();
var length = string.length;
var left = string.substr(0, length / 2);
var right = string.substr(length / 2, length);
if (left === right) { return number; }
return number * 2;
}
@z4o4z
z4o4z / observable
Last active February 12, 2016 14:37
"use strict";
var events = Symbol("events");
function MyObserver () {
this[events] = {};
}
MyObserver.prototype = {};
let brackets = {
"[": "]",
"{": "}",
"(": ")",
"<": ">"
}
function correctBrackets (str) {
const vals = Object.keys(brackets).map(key => brackets[key]);
const keys = Object.keys(brackets);
function greatestCommonPrimeDivisor(a, b) {
var aCPDs = getCPDs(a);
var bCPDs = getCPDs(b);
var max = -1;
for (var i = 0; i < aCPDs.length; i++) {
for (var j = 0; j < bCPDs.length; j++) {
if (aCPDs[i] === bCPDs[j] && max < aCPDs[i]) {
max = aCPDs[i];
}
"use strict";
let path = require('path');
let args = require('yargs').argv;
let webpack = require('webpack');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let CopyWebpackPlugin = require('copy-webpack-plugin');
const PATH_DIST = path.join(__dirname, 'dist');
import { param } from 'jquery';
import { Controller } from 'marionette';
import ProjectController from '../controllers/ProjectController';
import logger from '../helpers/logger';
const settings = {};
settings.facebook = {
'use strict'
$(function() {
function Quotes() {
var self = this;
self.wrapperObj = $('.wrapper');
self.newQuoteButton = $('.getNewQuote');
self.socialButton = $('.social-buttons__item');
self.quoteContainer = $('.quoteContainer');
self.authorContainer = $('.authorContainer');
'use strict';
let path = require('path');
let args = require('yargs').argv;
let webpack = require('webpack');
let HtmlWebpackPlugin = require('html-webpack-plugin');
let ExtractTextPlugin = require('extract-text-webpack-plugin');
let StyleLintPlugin = require('stylelint-webpack-plugin');
let ImageminPlugin = require('imagemin-webpack-plugin').default;
let autoprefixer = require('autoprefixer');
@z4o4z
z4o4z / cloudSettings
Last active October 14, 2020 08:34
Visual Studio Code Sync Settings Gist
{"lastUpload":"2020-10-14T08:34:27.145Z","extensionVersion":"v3.4.3"}
function zoom(n) {
const length = n % 2 ? n : n - 1;
const center = (length - 1) / 2;
if (length < 0) {
return '';
}
function getSquare(square, level, symbol) {
if (level * 2 > length) {