View counties.json
This file contains 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
{ | |
"countries": { | |
"colombia": { | |
"name": "Colombia", | |
"code": "CO" | |
}, | |
"egypt": { | |
"name": "Egypt", | |
"code": "EGY" | |
}, |
View vscode-eslint-autofix-keybinding
This file contains 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
{ | |
"key": "shift+alt+f", | |
"command": "editor.action.codeAction", | |
"args": { | |
"kind": "source.fixAll.eslint", | |
"apply": "first" | |
} | |
} |
View generate-random-number.js
This file contains 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
Math.floor(Math.random() * 100) + 1 | |
// 1 -> start | |
// 100 -> end |
View getBase64.js
This file contains 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
const getBase64 = fileURL => | |
new Promise(async resolve => { | |
const response = await fetch(fileURL); | |
const blob = await response.blob(); | |
const reader = new FileReader(); | |
reader.readAsDataURL(blob); | |
reader.onloadend = () => { | |
const base64data = reader.result; | |
resolve(base64data); |
View formatDate.js
This file contains 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 moment from 'moment'; | |
export default ({ year, month, day }) => { | |
const locale = 'en-US'; | |
const val = moment() | |
.year(year) | |
.month(month) | |
.date(day); | |
moment.locale(locale); | |
const formatter = moment.localeData().longDateFormat('L'); |