create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
function toSeconds(time_str) { | |
// Extract hours, minutes and seconds | |
var parts = time_str.split(':'); | |
// compute and return total seconds | |
return parts[0] * 3600 + // an hour has 3600 seconds | |
parts[1] * 60; // a minute has 60 seconds | |
} | |
var difference = Math.abs(toSeconds(StartTime) - toSeconds(EndTime)); | |
// format time difference |
var result = Row.reduce(function(result, field, index) { | |
result[Column[index]] = field; | |
return result; | |
}, {}) |
const filteredItems = questions.slice(0, i).concat(questions.slice(i + 1, questions.length)) | |
// Es6 | |
Temp = array.filter((item) => item !== value); // it will return all values except "value" |
<script src="https://unpkg.com/react@16/umd/react.development.js"></script> | |
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> | |
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script> |
var atten = { | |
_list:[], | |
set addname(name) // set | |
{ | |
this._list.push(name); | |
}, | |
get list(){ //get | |
return this._list.join(','); | |
} |
class name{ | |
constructor(a,b){ | |
this.a =a ; | |
this.b = b; | |
} | |
new(){ | |
console.log(`${this.a} and ${this.b}`); | |
} | |
} |
(async(loginName) => { | |
try { | |
var response = await fetch(`https://api.github.com/users/${loginName}/followers`); | |
var json = await response.json(); | |
var followerList = json.map(user => user.login); | |
console.log(followerList); | |
} catch(e) { | |
console.log("Data didn't load", e); | |
} | |
})('loginname'); |
const delay = seconds => { | |
return new Promise( | |
resolve => setTimeout(resolve, seconds * 1000) | |
) | |
}; | |
const countToFive = async() => { | |
console.log('zero seconds'); | |
await delay(1); | |
console.log('one second'); |
const myfn = () => | |
fetch('http://api.open-notify.org/astros.json') // need to add link to json file | |
.then(any =>any.json()); | |
const nmyfn =() => // new function | |
myfn() // function call | |
.then(json => json.people) | |
.then(people => people.map(p => p.name)) // parse | |
.then(names=>names.join(" , " )); // join with (,) and space |