Skip to content

Instantly share code, notes, and snippets.

View yesley's full-sized avatar
🍩
Doing nothing ^_^

Yaroslav Kovalev yesley

🍩
Doing nothing ^_^
View GitHub Profile
// index.js

const foo = 'a'

class Animal {
  constructor() {
    const foo = 'b'
  }
  
@yesley
yesley / reverse-map.js
Created May 1, 2020 17:27
Build both map and reverse map for entries in a fancy way
const buildFullMap = entries => entries.reduce((map, [key, value]) => {
map[map[key] = value] = key
return map
}, {})
@yesley
yesley / generate-keys.sh
Created July 30, 2020 16:01
Generate ssh keys pair suitable for both Travis CI and GitHub
ssh-keygen -P "" -t rsa -b 4096 -m pem -f my-key-pair
const date = new Date()
const formatOptions = {
hour12: false,
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
}
const dtVolgograd = new Intl.DateTimeFormat("en-US", {
...formatOptions,