Skip to content

Instantly share code, notes, and snippets.

View NataliShip's full-sized avatar
🏡
Working from home

Наталия Шипелова NataliShip

🏡
Working from home
View GitHub Profile
@holdenhinkle
holdenhinkle / rail_fence_cipher_1.js
Last active December 13, 2019 14:22
This solution is wrong. I misunderstood the problem.
function railFenceCipher(operation, string, height = 3) {
function performOperation(operation, string, height, lines) {
let results = ''; // only for decrypt
let currentLine = 0;
let moveUp = true;
let moveDown = false;
for (let i = 0; i < lines[0].length; i += 1) {
if (operation === 'encrypt') {
lines[currentLine].splice(i, 1, string[i]);
function railFenceCipher(operation, string, height = 3) {
function encrypt(string, height, fence) {
let currentRail = 0;
let moveUp = true;
let moveDown = false;
for (let i = 0; i < fence[0].length; i += 1) {
fence[currentRail].splice(i, 1, string[i]);
if ((moveUp && currentRail + 1 > height - 1) ||
@nikneroz
nikneroz / redux_saga.md
Last active December 23, 2021 20:33
Лекция №3: Redux-Saga
API_CALL_REQUEST описывает что мы начинаем процесс получения данных с API
API_CALL_SUCCESS описывает что store успешно получил данные и процесс получения данных завершен
API_CALL_FAILURE описывает что API вызов завершился ошибкой