WepPackDevServer

Part of webpack. Needed for hot reload, also can serve requested files.

configure in webpack.config

    devServer: {
        port: 3003,
        static: {
            directory: path.join(__dirname, 'out'),
            publicPath: `/path/${APP_VERSION}/`,
        },
    },

Start it like this

npx webpack serve --config webpack.config.ts --mode production

after start it will show smth like

<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:3003/
<i> [webpack-dev-server] On Your Network (IPv4): http://10.6.14.56:3003/
<i> [webpack-dev-server] Content not from webpack is served from 

How to define which files it can serve ?

http://localhost:3003/webpack-dev-server

After showing, click any of them and you will see the adress, so you can pick any of them.

For example you can add this way a source map

http://localhost:3003/path/sourceMaps/js/main.js.map
Posted in Без рубрики | Comments Off on WepPackDevServer

Git. Rev-Parse. Getting latest commit

It helps you to find out the commit ID of the current HEAD (i.e. the current commit you are viewing)

git rev-parse HEAD
OR if you want the shorter commit

git rev-parse --short HEAD
If you want to find the latest commit in another branch, you can do

git rev-parse <local-branch-name>
git rev-parse origin/<remote-branch-name>

Source

Posted in Без рубрики | Comments Off on Git. Rev-Parse. Getting latest commit

Git.Log

git log --oneline

will log commits in one line

Posted in Без рубрики | Comments Off on Git.Log

Git.Revert

git revert [commitHash, HEAD] --no-edit

will add commit to history that will revert commitHash commit

history will not be overwritten

Posted in Без рубрики | Comments Off on Git.Revert

Git. Clean

git clean -f -d

will clean all untracked files and directories

Posted in Без рубрики | Comments Off on Git. Clean

Git. Reset

git reset [--hard, --mixed, --soft] [commitHash, file, HEAD~N]

–hard will erase all

–mixed will move out from index

–soft will be visible only on another commit, and don’t move out from index

Posted in Без рубрики | Comments Off on Git. Reset

Git. Amend

this will reset and make new commit and leaves the previous msg

git commit --amend --no-edit
Posted in Без рубрики | Comments Off on Git. Amend

Git. Making commits history clean in the branch

if i stay on my feature branch and want to sync with develop lets say

git rebase develop

it will put commits in feature branch to tip of the main

merge develop into feature, overwrite history in my branch

other option

git merge develop
git rebase develop
Posted in Без рубрики | Comments Off on Git. Making commits history clean in the branch

Git. How do i squash commits?

Option number one

git reset --soft HEAD~3 // number of commits back grom the head
git add -A
git commit --no-verify -m "squashed"
git push --force // or iw work in one branch with teammates git push --force-with-lease 

Option number two

In jetBrains products

Git -> popup on selected commits -> squash

Option number three

In Tortoise Git

Show Log -> Selected commits -> Squash // but here should be clean working tree

Posted in Без рубрики | Comments Off on Git. How do i squash commits?

Delphi.Masterpiece.Connections and ini settings

Connection to postgres

Adding ini file, for ex. Domain.Registry.Tests.ini

[HostConnectionSettings.Sections.|sbsmb|.{B3026AF7-6447-438B-897D-835ADBF020AA}.PG]
Ip=localhost
Port=5432
VendorHome=..\libpq
Login=DAF7528291F804C0F9CA0F0C1B8085E51D4AB8AEF226D194
Password=
Name=sbsmb

Connecting in the code

  var LConns := Service<IConnections>(S_FD_PGId);
  FConnection := LConns['sbsmb'];

Watch settings from ini in the code

  var LSettingsPG := Service<ISections<IHostConnectionSetting>>.All.Values;
  var LCount := LSettingsPG.Count;

For Oracle it will be IHostConnectionSetting in spite of IConnectionSetting

Posted in Без рубрики | Comments Off on Delphi.Masterpiece.Connections and ini settings