things to note in JS while learning them. putting from my private notes to public gist.
TODO
- hoisting
- Scope of var
- inheritence in es5
- currying
- setTimeout
To make this a little more concrete, let’s look at a couple of examples. First off, let’s take a look at some simple cases, starting with some uses of ramda: | |
import { merge, add } from 'ramda' | |
export const withDefaultConfig = (config) => | |
merge({ path: '.' }, config) | |
export const add5 = add(5) | |
The first example here is pretty obvious: in withDefaultConfig, merge is used purely as an implementation detail, so it’s safe, and it’s not part of the module’s interface. In add5, the example is a little trickier: the result of add(5) is a partially-applied function created by Ramda, so technically, a Ramda-created value is a part of this module’s interface. However, the contract add5 has with the outside world is simply that it is a JavaScript function that adds five to its argument, and it doesn’t depend on any Ramda-specific functionality, so ramda can safely be a non-peer dependency. |
https://github.com/FreemanZhang/system-design |
#In your ~/.gitconfig you can put something like this. | |
# git version > 2.13 | |
# https://stackoverflow.com/questions/8801729/is-it-possible-to-have-different-git-config-for-different-projects/43884702#43884702 | |
[includeIf "gitdir:~/company_a/"] | |
path = .gitconfig-company_a | |
[includeIf "gitdir:~/company_b/"] | |
path = .gitconfig-company_b | |
https://medium.com/@FloSloot/node-js-is-not-single-threaded-88928ada5838 | |
If you were anything like me, you would’ve come here thinking: | |
What the heck is he talking about?! Of course Node.js is single threaded! | |
But that’s only partially true! Bare with me. | |
TL;DR |
As programmers, we must configure Spring. Spring must know:
Where to start In this case, start with SpringApplication.run() Which classes the container must process In this case, use Annotations How to create instances of classes For Spring annotations, use @Component, @Service, @Bean, etc. For JSR330 annotations, use @Named