Common services shared across web projects.
- compile
- start from IntelliJ
- start from terminal
- run tests
- run gradle test
- deploy war
- check logs and errors
- Always wait a year after beta release of common framework to be used in the project. (spring boot, spring security)
- Half a year for less significant projects (flyway, logback, webpack).
- Confgure git, .editorconfig and IntelliJ to use lf line separators
git config --global core.autocrlf input
- remember to wrap postgres do blocks with
begin
andend
- you don't need setters on model objects jackson sets value by reflection
- always sepcify method of
@RequestMapping
otherwise cors options request will invoke rest method twice - use plural names for endpoint urls
DejaVu Sans Mono 14 (or 15 on small dekstops)
- GetMapping verificaition
- Repository grouping
- Moduł z env build arg
- Klasa abstrakcyjna w common i implementacja serwisu - jeśli różnie konfigurowane w różnych aplikacjach
- Profile - jeśli różnie konfigurowane w różnych aplikacjach
- application.properties - bean based on property goo.gl/U1rnXX, @ConditionalOnProperty
- Primary - jeśli różnie konfigurowane w tylko jednej aplikacji
- Order - ...
Odetnij wersje
git tag -f release-xxx && git push -f --tags
Znajdź usunięty plik
git log --all --full-history -- */xxx.java
git grep xxx $(git rev-list --all)
Dependency tree
./gradlew dependencies | grep -i -B 10 xxx
Update last commit
git pull && git add -A && git commit --amend --no-edit && git push -f
List files sorted by loc
git ls-files | xargs wc -l | sort -n -k 1 | tail -n 20
Delete empty directories
find . -type d -empty -delete
Show only blank lines changes
#!/usr/bin/env bash
function main() {
for f in `git diff --name-only`; do
MY_DIFF=$(git diff --ignore-blank-lines ${f} | cat)
if [[ ! ${MY_DIFF} == "" ]]; then echo "${f}"; fi
done
}
diff <(main) <(git diff --name-only)
Split repositories
git filter-branch --tree-filter 'rm -rf zamowienia-server-core' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git commit -m 'Removing zamowienia-server-core from git history'
git gc
git push origin master --force
git filter-branch --prune-empty --subdirectory-filter zamowienia-server-core
git remote set-url origin new-repo
git push -u origin master