angular4 No provider for ControlContainer
Problem: Received error: No provider for ControlContainer!
Solution:
- forgot to include FormsModule besides ReactiveFormsModule in my app.module.ts :)
typescript this implicitly has type 'any'
Problem: received this error in typescript: ‘this’ implicitly has type ‘any’ because it does not have a type annotation.
Solution:
- Found here
curl with proxy
Problem: want to make a curl request using a proxy.
Solution:
- Specify -x flag like in the example below ( assuming you have a proxy server running at localhost, on port 8080) :
fix vscode flow Type aliases can be used only in a .ts file
Problem: Type aliases can be used only in a .ts file appears when working with flowtype.
Solution:
- found here
- go to Code -> Preferences -> Settings
- in your workspace make this change:
HtmlWebpackPlugin insert dynamic value
Problem: add a value in index.html depending on a condition
Solution:
- modify webpack file, to have this ( notice the someValue key ):
- then modify index.html with your logic, and make use of the value, like in the following snippet:
generate range of numbers in es6
Problem: want to generate an array containing all values up to a number.
Solution:
- Found here
- […Array(n).keys()]
go RPC failed; HTTP 301 curl 22 The requested URL returned error 301
Problem: received this message when trying to install gopkg.in/go-playground/validator.v9
RPC failed; HTTP 301 curl 22 The requested URL returned error: 301
Solution: Found here:
git config --global http.https://gopkg.in.followRedirects true
webpack ignore plugin
The ignore plugin was useful to reduce the size of moment.js. Found this answer, which gave this useful snippet:
Couple that with the BundleAnalyzerPlugin ( config has to be done in webpack.config.js ) :
and you have a really nice way of seeing what causes your js file to be so big.
useful aliases for profiling go performance
Problem: I never remember the syntax for go tool pprof
Solution: have these aliases saved.