This file contains hidden or 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
import fs from 'fs'; | |
import path from 'path'; | |
import process from 'process'; | |
import { exec } from 'child_process'; | |
import readline from 'readline'; | |
// const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); | |
// function ask(text = '') { return new Promise((resolve) => rl.question(text, (answer) => resolve(answer))); } | |
readline.emitKeypressEvents(process.stdin); |
This file contains hidden or 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> | |
<head> | |
<title>Invited customers</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
<!-- <script src="JS/lib/jquery.js"></script>--> |
This file contains hidden or 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
// Random test | |
for (var test_num = 0; test_num <= 20; test_num++){ | |
var nested_array = set_nested_array(0); | |
console.log('Test ' + test_num + '; nested_array = '); | |
console.log(nested_array); | |
console.log('Flattened array -> ' + nested_array.get_flattened_array()); | |
} |
This file contains hidden or 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
/********************************************************************************************/ | |
/* Recursive function to flatten all nested elements of an array. */ | |
/* */ | |
/* - Each recursive iteration returns a new the flatered array with all its nested levels. */ | |
/* - The flattened array is built by a plain concatenation of each return callback. */ | |
/* */ | |
/* Example: [[1,2,[3]],4].get_flattened_array(); */ | |
/********************************************************************************************/ | |
Array.prototype.get_flattened_array = function() { | |
return this.reduce( |