Thursday, June 13, 2019

As for working with legacy FE code base (AngularJs) there is almost always some need to use older node versions. Nice way for that is just install nvm, using directly from curl https://github.com/nvm-sh/nvm sometimes doesn't work. But installations using brew works like a charm.
Some information can be found here: https://michael-kuehnel.de/node.js/2015/09/08/using-vm-to-switch-node-versions.html

Tuesday, June 11, 2019

As for my favorite editor for coding, for some years now I used VS Code and seems like in many ways this is the 'de facto' must editor for the Front-End. So time to time I'll post some tips on how to use it right. First things first install it to you Mac's .bash_profile with this:
https://code.visualstudio.com/docs/setup/mac

After that you can use it as normal editor.
Run for example:
$>npm audit >> ~/NPM.report.txt
$>code ~/NPM.report.txt
And here it is you own npm report in you lovely code.

Friday, June 2, 2017

Install kdiff3 on MacOs

The easiest way is to install it with homebrew this is and was pretty cool package manager for MacOs. But you can find kdiff3 in homebrew so you will want to install caskroom as well. And then kdiff3.

All can be done just in two lines of code:

brew tap caskroom/cask
brew cask install kdiff3

And now have it in your Applications. Next step is to configure your git cli by modifying ~/.gitconfig:

[difftool "kdiff3"]
    path = /Applications/kdiff3.app/Contents/MacOS/kdiff3
    trustExitCode = false
[difftool]
    prompt = false
[diff]
    tool = kdiff3
[mergetool "kdiff3"]
    path = /Applications/kdiff3.app/Contents/MacOS/kdiff3
    trustExitCode = false
[mergetool]
    keepBackup = false
[merge]

    tool = kdiff3

After that you are ready to use you kdiff3 as difftool in git command line:

$>git difftool branchName

Thursday, June 25, 2015

Create custom error_page with nginx to resolve 400 Bad Request custom error page problem. Let's say www.host/% -> will return some Bad Request 400 but not custom error message from nginx.

To note:
error_page handles errors that are generated by nginx. By default, nginx will return whatever the proxy server returns regardless of http status code.

http://stackoverflow.com/questions/8715064/nginx-not-serving-my-error-page

Remember to check if your errors are actually from nginx and not from Tomcat or what so ever.
http://wiki.nginx.org/HttpProxyModule#proxy_intercept_errors
then add to server or location:
...
proxy_intercept_errors on;
...
Then write some custom error page:
Something like this:
https://vpsineu.com/blog/how-to-setup-nginx-to-show-custom-error-pages-on-a-centos-7-vps/
restart: service nginx restart
And test.
Some host/% error can be fixed with this one. So when getting some 400 from this request, you can create some custom error_page with nginx if just place this directive.