Intro to hooks https://www.youtube.com/watch?v=jd8R0a2Ur8Q
Custom Hooks https://www.youtube.com/watch?v=fnT5b2u1PHE
{ | |
// Work Bench | |
"breadcrumbs.enabled": true, | |
"workbench.colorTheme": "Field Lights", | |
"workbench.editor.tabSizing": "shrink", | |
"workbench.sideBar.location": "left", | |
"workbench.startupEditor": "newUntitledFile", | |
"workbench.statusBar.visible": true, | |
"workbench.editor.empty.hint": "hidden", | |
"workbench.activityBar.location": "top", |
############################ | |
# Environment Variables | |
############################ | |
.env* | |
!.env.example | |
############################ | |
# Archives | |
############################ | |
*.7z |
tap "homebrew/bundle" | |
tap "homebrew/services" | |
# Formulae | |
# Clone of cat(1) with syntax highlighting and Git integration | |
brew "bat" | |
# Modern, maintained replacement for ls | |
brew "eza" | |
# Simple, fast and user-friendly alternative to find | |
brew "fd" |
const pubSub = () => { | |
// The core of our pubsub implementation | |
const subscriptions = {} | |
// Stupid naive way to generate an ID for each subscription. | |
// Should really be something more robust, but this is a simple implementation after all | |
const generateID = () => Math.floor(Math.random() * 100); | |
// Publish handler. Runs all the callbacks for a given eventName | |
const publish = (eventName, data) => subscriptions[eventName] && subscriptions[eventName].map(subscription => subscription.callback(...data)); |
/** | |
* A deep clone implementation, with immutability. | |
*/ | |
const cloneObject = input => { | |
if ( | |
!Array.isArray(input) && | |
Object.getPrototypeOf(input).toString.call(input) !== "[object Object]" | |
) { | |
return input; | |
} |
/** | |
* themeGetObject | |
* | |
* Generates an object with a 'get' property for each property on a theme object. | |
* Each property is a function that returns a value from that theme property. | |
* | |
* @param theme The theme to return an object for | |
* | |
* @returns {Function} | |
* |
{ | |
"article": { | |
"meta": { | |
"title": "Test Post", | |
"date": "" | |
}, | |
"content": [ | |
{ | |
"element": "h1", | |
"content": ["This is a heading"], |
const lower = 'abcdefghijklmnopqrstuvwxyz'; | |
const upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
const numbers = '0123456780'; | |
const symbols = '!@#$%^&*_+-/~?' | |
/** | |
* Generate a password from any number os groups of strings | |
* | |
* @example generatePassword([upper, symbols], 26) | |
* |
Intro to hooks https://www.youtube.com/watch?v=jd8R0a2Ur8Q
Custom Hooks https://www.youtube.com/watch?v=fnT5b2u1PHE