Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit cc35088

Browse files
authored
Merge pull request #70 from mobilejazz/develop
Update `master` with latest changes
2 parents 8df0afb + a270df5 commit cc35088

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

docs/other/tips/angular.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: Angular
3+
---
4+
## Tips and Tricks for Angular
5+
6+
### Build with 0 downtime on Angular
7+
8+
The recommended way to have 0 downtime it's using dockerized builds with a docker registry service.
9+
In case that this isn't possible in your project, here you have a quick fix.
10+
11+
Create this folders on `/dist`:
12+
13+
1. `/dist/previousbuild`
14+
1. `/dist/nginx` (the new production path)
15+
16+
`package.json` add on `scripts` section:
17+
```json
18+
...
19+
"prebuild": "rm -rf dist/previousbuild",
20+
"build": "ng build --prod --source-map --optimization=true --buildOptimizer=true --progress=true",
21+
"postbuild": "mv dist/nginx dist/previousbuild && mv dist/tempbuild dist/nginx",
22+
...
23+
```
24+
25+
`angular.json` add on `projects -> *projectname* -> architect -> build -> options`:
26+
```json
27+
...
28+
"outputPath": "dist/tempbuild",
29+
...
30+
```
31+
32+
And the result:
33+
34+
1. on build starts, the folder `previousbuild` will be erased
35+
1. the new build will be created on `tempbuild`
36+
1. when the new build is done, the previous production build will move to `previousbuild` and the new one will be on
37+
`nginx` folder
38+
1. in case that you need to recover the previous version, you only need rename the two folders

docs/other/tips/git.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: Git
3+
---
4+
## Tips and Tricks for Git
5+
6+
### Git Submodules
7+
8+
```bash
9+
// 1. Add submodule to a new repo
10+
git submodule add https://github.com/chaconinc/DbConnector
11+
12+
// 2. Updating repo with new submodule
13+
git pull
14+
git submodule update --init --recursive
15+
16+
// 2. Or Cloning repo with new submodule
17+
git clone --recurse-submodules https://github.com/chaconinc/MainProject
18+
19+
// 3. Pulling repo with submodules
20+
git pull --recurse-submodules
21+
```
22+
23+
by [git](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
24+
25+
### Delete branch locally and remotely
26+
27+
```bash
28+
// 1. locally
29+
git branch -d localBranchName
30+
31+
// 2. remote
32+
git push origin :remoteBranchName
33+
```
34+
35+
by [FreeCodeCamp](https://forum.freecodecamp.org/t/how-to-delete-a-git-branch-both-locally-and-remotely/13211)
36+
37+
### Apply .gitignore to committed files
38+
39+
```bash
40+
// Edit your .gitignore with the file to ignore and run
41+
git rm --cached /path/to/file
42+
```
43+
44+
by [SO](https://stackoverflow.com/questions/7527982/applying-gitignore-to-committed-files)
45+
46+
### Git ignore file mode (chmod) changes
47+
48+
```bash
49+
// Only current repo
50+
git config core.fileMode false
51+
52+
// General
53+
git config --global core.fileMode false
54+
```
55+
56+
by [SO](https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes)

docs/other/tips/node.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Node
3+
---
4+
## Tips and Tricks for Node
5+
6+
### npm install
7+
8+
Unlike with PHP `composer install`, the command `npm install` takes `package.json` and resolves the dependencies which means that you might introduce a version different from the one you tested on.
9+
10+
For deploys, CI or initial local environment setup, the **recommended** way to install the dependencies of a project is using `npm ci`.

src/sidebars.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ module.exports = {
150150
}
151151
]
152152
},
153+
{
154+
type: 'category',
155+
label: 'Tips and Tricks',
156+
items: [
157+
'other/tips/node',
158+
'other/tips/angular',
159+
'other/tips/git'
160+
]
161+
},
153162
{
154163
type: 'category',
155164
label: 'Old',

0 commit comments

Comments
 (0)