Skip to content

Instantly share code, notes, and snippets.

View pfftdammitchris's full-sized avatar
💭
Dreaming

Christopher Tran pfftdammitchris

💭
Dreaming
View GitHub Profile
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,
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)
}
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
}
function Command(name, execute) {
this.name = name
this.execute = execute
}
Command.prototype.toString = function() {
return this.name
}
const createCommandHub = function() {
const obj = {
foods: {
apples: ['orange', 'pineapple'],
},
water: {
f: '',
},
tolupa: function() {
return this.name
},
const people = {
bob: {
age: 15,
gender: 'male',
},
jessica: {
age: 24,
gender: 'female',
},
lucy: {
@pfftdammitchris
pfftdammitchris / typescriptreact.json
Created January 19, 2020 22:50
VSCode User Snippets (Workspace | Styled-Components)
{
"import AppContext": {
"prefix": "appc",
"body": "import AppContext from 'app/AppContext'"
},
"border test": {
"prefix": "b1",
"body": "border: 1px solid red;"
},
"border test2": {
@pfftdammitchris
pfftdammitchris / settings.json
Created June 9, 2020 14:48
VSCode Settings
{
"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",
{
"backgroundColor": "#020303",
"color": "#201313",
"fontSize": "14px",
"width": "90px",
"height": "50px",
"textAlign": "center",
"display": "flex",
"alignItems": "center",
"justifyContent": "center"
class CumulativeSum {
constructor() {
this._executor = null
}
get executor() {
if (!this._executor) return (val) => val
return this._executor
}