Skip to content

Instantly share code, notes, and snippets.

const smallestDivisor = (num) => {
const iter = (acc) => {
// We use 'num / 2' in the condition below, and not 'num'.
// This is a simple optimization: a number cannot be divided
// by a number larger than its half.
if (acc > num / 2) {
return num;
}
if (num % acc === 0) {
return acc;
// BEGIN (write your solution here)
const smallestDivisor = num => {
let divisor = 2;
if(num < 1) {
return NaN;
}
if(num === 1) {
return num;
import { length } from './strings'; // eslint-disable-line
// BEGIN (write your solution here)
const sum = (str) => {
let result = 0;
for(let i = 0; i < length(str); i++) {
result += Number(str[i]);
}
import { length, toUpperCase } from './strings';
// BEGIN (write your solution here)
export default (str) => {
let result = "";
for(let i = 0; i < length(str); i++) {
const shouldBeBig = str[i] !== " " && (i === 0 || str[i - 1] === " ");
result += shouldBeBig ? toUpperCase(str[i]) : str[i];
}
const isPalindrome = (string) => {
if (length(string) <= 1) {
return true;
}
const firstSymbol = string[0];
const lastSymbol = string[length(string) - 1];
if (firstSymbol !== lastSymbol) {
return false;
}
import { getLength } from './strings'; // eslint-disable-line
// BEGIN (write your solution here)
const substr = (str, start = 0, size = getLength(str)) => {
const length = getLength(str);
if(start >= length) {
return '';
}
export const table = (...children) => `<table>${children.join('')}</table>`;
export const tr = (...children) => `<tr>${children.join('')}</tr>`;
export const td = (...children) => `<td>${children.join('')}</td>`;
export const p = (...children) => `<p>${children.join('')}</p>`;
export//////////////
export default () => table(
tr(td('lang'), td('comment')),
tr(td('php'), td('statements')),
let webpack = require('webpack');
let webpackDefaultConfig = require('./webpack-default');
let Entry = require('./Entry');
let webpackRules = require('./webpack-rules');
let webpackPlugins = require('./webpack-plugins');
process.noDeprecation = true;
class WebpackConfig {
fs.js:143
throw err;
^
Error: EISDIR: illegal operation on a directory, read
at Object.fs.readSync (fs.js:632:3)
at tryReadSync (fs.js:472:20)
at Object.fs.readFileSync (fs.js:513:19)
at Function.concatenate.sync (C:\OpenServer\domains\crm2.local\node_modules\concatenate\lib\concatenate.js:122:17)
at FileCollection.merge (C:\OpenServer\domains\crm2.local\node_modules\laravel-mix\src\FileCollection.js:29:36)
driver
.wait(until.elementLocated(By.css(createBtn)), 20000)
.then(function(element) {
return driver.wait(until.elementIsVisible(element), 20000);
})
.then(function(button) {
driver
.actions()
.mouseMove(button)
.mouseUp()