Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandr Dadykin cetrix13

View GitHub Profile
@cetrix13
cetrix13 / makeRequest.js
Last active Sep 12, 2019
Function that repeats number of times requests to a server
View makeRequest.js
const URL = 'https://data-live.flightradar24.com/zones/fcgi/feed.js?bounds=56.84,55.27,33.48,41.48';
function makeRequest(url, num) {
return new Promise(function(resolve, reject) {
fetch(url)
.then(result => resolve(result))
.catch(err => {
if (num === 1) return reject(err);
makeRequest(url, num - 1).then(resolve).catch(reject);
})
@cetrix13
cetrix13 / .eslintrc.js
Created Jan 30, 2019
Default configuration of eslint
View .eslintrc.js
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 2016
},
"rules": {
You can’t perform that action at this time.