Node.js:
Concepts review (in JavaScript, but it’s more suitable to create ‘em here):
- this is (quoted from the page) “When a function is invoked, an activation record, otherwise known as an execution context, is created. This record contains information about where the function was called from (the call-stack), how the function was invoked, what parameters were passed, etc. One of the properties of this record is the this reference which will be used for the duration of that function’s execution. … this is actually a binding that is made when a function is invoked, and what it references is determined entirely by the call-site where the function is called.”
- Procedural VS Class-oriented
- Destructuring
Python:
Project arch
Why decorators?
Revisits:
- Abstract Base Class (ABC)
- Dont Repeat Yourself (Super DRY)
- Liskov Substitution Principle (LSP)
- Regular Methods VS Class Methods VS Static Methods
- future 2 -> 3
- isinstance VS issubclass
- Magic/Dunder Methods
- placeHolder AND format
React:
Babel REPL
Before you roll your sleeves
Create Simple React App
- I appreciate this design wisdom and quote from the page – ‘When you want to aggregate data from multiple children or to have two child components communicate with each other, move the state upwards so that it lives in the parent component. The parent can then pass the state back down to the children via props, so that the child components are always in sync with each other and with the parent.’
- Conventionally, use on__ and __handle for attributes and handling methods respectively
- Assign proper keys whenever you build dynamic lists – advice from React’s tutorial
- Immutability VS Time Traversal
- Controlled Components
Create React App
props
state
- setState
lifecycle hooks
- componentWillMount
- componentDidMount
- If you are as confused as me …
JSX
JSX uses capitalization to differentiate between HTML elements and React components. If the first letter is lowercase, the tag is assumed to be an HTML element, and turned into a string. If it’s uppercase, the tag is assumed to be a variable name in scope (usually a component) – quoted from this (Umm… No wonder …) Curly braces “escape” from JSX back into normal JS expressions. They are used to insert values from variables and comment out code – quoted from this (Umm… No wonder X 2 …)
routing (???)
Vim:
Python class folding …
Python looping folding …
Git:
Purge big files from (remote) rep
- Find the biggest files
- Purge it – though the original purpose of this article is to purge sensitive files <3
- Dont forget to clean up local rep after purging
git for-each-ref --format='delete %(refname)' refs/original | git update-ref --stdin git reflog expire --expire=now --all git gc --prune=now