This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="style.css"> | |
<title>Document</title> | |
</head> | |
<body> | |
<div class="slider"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const calc = require('./calculator.js'); | |
const myCalculator = new calc.myCalc(); | |
console.log(myCalculator.summ(7, 8)); | |
console.log(myCalculator.diff(4, 10)); | |
console.log(myCalculator.divv(4, 5)); | |
console.log(myCalculator.mult(4, 9)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let inFile = document.querySelector('#inFile'); | |
let outFile = document.querySelector('#outFile'); | |
let fileReader = new FileReader(); | |
fileReader.addEventListener('load', () => { | |
outFile.src = fileReader.result; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ДЗ 3 - работа с массивами и объеектами */ | |
/* | |
Задача 1: | |
Напишите аналог встроенного метода forEach для работы с массивами | |
*/ | |
function forEach(array, fn) { | |
for (let i = 0; i < array.length; i++) { | |
fn(array[i], i, array); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ДЗ 2 - работа с исключениями и отладчиком */ | |
/* | |
Задача 1: | |
Функция принимает массив и фильтрующую фукнцию и должна вернуть true или false | |
Функция должна вернуть true только если fn вернула true для всех элементов массива | |
Необходимо выбрасывать исключение в случаях: | |
- array не массив или пустой массив (с текстом "empty array") | |
- fn не является функцией (с текстом "fn is not a function") | |
Зарпещено использовать встроенные методы для работы с массивами |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ДЗ 1 - Функции */ | |
/* | |
Задание 1: | |
Функция должна принимать один аргумент и возвращать его | |
*/ | |
function returnFirstArgument(arg) { | |
return arg; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const todos = require('./todos.json'); | |
app.get('/', function (req, res) { | |
res.send('Home Page'); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getValue (flag) { | |
const index = process.argv.indexOf(flag); | |
if (index > -1) { | |
return process.argv[index + 1]; | |
} | |
} | |
const name = getValue('-n'); | |
const mesage = getValue('-m'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); // подключаем модуль файловой системы | |
const zlib = require('zlib'); // подключаем модуль компрессии | |
const gzip = zlib.createGzip(); // создаём переменную для компрессии | |
const inp = fs.createReadStream('test.txt'); // входящий поток, чтение файла | |
const out = fs.createWriteStream('test2.txt.gz'); // исходящий поток, запись компрессионного файла test2.txt.gz | |
inp.pipe(gzip).pipe(out); // входящий поток, пайпит через поток компрессии и снова пайпит в исходящий поток для создания файла |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<form action="/" method="post"> | |
<input type="text" placeholder="Login" name="username"> | |
<input type="password" placeholder="password" name="password"> |
NewerOlder