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
export const audioExts = ['mp3', 'mpa', 'ogg', 'wav'] | |
const icons = { | |
edit: { | |
component: EditIcon, | |
onClick: () => window.alert('You clicked the edit component'), | |
name: 'edit', | |
}, | |
delete: { | |
component: DeleteIcon, |
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
function findFatDogs(dog, result = []) { | |
if (dog && dog.children) { | |
return dog.children.reduce((acc, child) => { | |
if (child && child.weight > 100) { | |
return acc.concat(child) | |
} else { | |
return acc.concat(findFatDogs(child)) | |
} | |
}, result) | |
} |
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
function findFatDogs(dog, result = []) { | |
if (dog?.children) { | |
return dog.children.reduce((acc, child) => { | |
return child?.weight > 100 | |
? acc.concat(child) | |
: acc.concat(findFatFrogs(child)) | |
}, result) | |
} | |
return result | |
} |
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
function Command(name, execute) { | |
this.name = name | |
this.execute = execute | |
} | |
Command.prototype.toString = function() { | |
return this.name | |
} | |
const createCommandHub = function() { |
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
const obj = { | |
foods: { | |
apples: ['orange', 'pineapple'], | |
}, | |
water: { | |
f: '', | |
}, | |
tolupa: function() { | |
return this.name | |
}, |
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
const people = { | |
bob: { | |
age: 15, | |
gender: 'male', | |
}, | |
jessica: { | |
age: 24, | |
gender: 'female', | |
}, | |
lucy: { |
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 AppContext": { | |
"prefix": "appc", | |
"body": "import AppContext from 'app/AppContext'" | |
}, | |
"border test": { | |
"prefix": "b1", | |
"body": "border: 1px solid red;" | |
}, | |
"border test2": { |
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
{ | |
"atomKeymap.promptV3Features": true, | |
"colorHelper.disableGpu": 1, | |
"colorHelper.formatsOrder": ["hex", "rgb"], | |
"colorHelper.pickerForm": "simple", | |
"colorHelper.resident": true, | |
"debug.console.fontSize": 10, | |
"editor.acceptSuggestionOnCommitCharacter": false, | |
"editor.autoClosingBrackets": "always", | |
"editor.autoIndent": "full", |
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
{ | |
"backgroundColor": "#020303", | |
"color": "#201313", | |
"fontSize": "14px", | |
"width": "90px", | |
"height": "50px", | |
"textAlign": "center", | |
"display": "flex", | |
"alignItems": "center", | |
"justifyContent": "center" |
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
class CumulativeSum { | |
constructor() { | |
this._executor = null | |
} | |
get executor() { | |
if (!this._executor) return (val) => val | |
return this._executor | |
} |