From 1f96f5322abf45c62d3dc80d8c966dc546f3225b Mon Sep 17 00:00:00 2001
From: Hau Nguyen
There are many use cases where we need to use a unique ID. In my
- experience, I only encouter 2 cases:
+ experience, I only encounter 2 cases:
The ID is used only for trace and log. If same ID is generated twice
- (because maybe the possibilty is too small but not 0), honestly I don't
+ (because maybe the possibility is too small but not 0), honestly I don't
care. When I use that ID to search log , if it pops more than things I
care for, it is still no harm to me.
Why?
See for yourself.
- Stay away from all kind of database timestamp (MySQL timestmap, SQLite
+ Stay away from all kind of database timestamp (MySQL timestamp, SQLite
timestamp, ...) Just use int64 then pass the timestamp in service layer
not database layer.
Need clarify why this happpen? Idk :( Need clarify why this happen? Idk :(
- Plase read docs about online ddl operations before do anything online
+ Please read docs about online ddl operations before do anything online
(keep database running the same time update it, for example create index,
...)
In my opinion, unit test is not that important (like must must have). It's - just make sure your code is running excatly as you intent it to be. If you + just make sure your code is running exactly as you intent it to be. If you don't think about edge case before, unit test won't help you.
tests := []struct{
diff --git a/docs/2023-03-05-incident.html b/docs/2023-03-05-incident.html
index 8d86083..da24bad 100644
--- a/docs/2023-03-05-incident.html
+++ b/docs/2023-03-05-incident.html
@@ -113,7 +113,7 @@
Chaos right there!
Solution: Use a lock, if user enter API upload, lock it
- to prevent user call other APIs. Rememeber to unlock after finished
+ to prevent user call other APIs. Remember to unlock after finished
diff --git a/docs/2023-04-17-keeb.html b/docs/2023-04-17-keeb.html
index 6a5ace2..c0fdb9f 100644
--- a/docs/2023-04-17-keeb.html
+++ b/docs/2023-04-17-keeb.html
@@ -327,7 +327,7 @@
Review:
Things I don't like:
- - Sandwhich style is meh when typing, so I buy Aluminium case.
+ - Sandwich style is meh when typing, so I buy Aluminium case.
- The left sandwich case is so tight to put switch in.
-
Sometimes right encoder is not working, I need to plug out and plug in
diff --git a/docs/2023-05-03-neovim.html b/docs/2023-05-03-neovim.html
index 6308aea..a630f8a 100644
--- a/docs/2023-05-03-neovim.html
+++ b/docs/2023-05-03-neovim.html
@@ -106,7 +106,7 @@
:sort -u
- Reverse lines (after selcting lines):
+ Reverse lines (after selecting lines):
:!tail -r
diff --git a/docs/2023-06-25-useful-tools.html b/docs/2023-06-25-useful-tools.html
index a2d04f1..762e992 100644
--- a/docs/2023-06-25-useful-tools.html
+++ b/docs/2023-06-25-useful-tools.html
@@ -45,12 +45,12 @@
~
@@ -666,12 +666,12 @@
diff --git a/docs/2023-07-01-pastebin.html b/docs/2023-07-01-pastebin.html
index 4cba246..4d449b5 100644
--- a/docs/2023-07-01-pastebin.html
+++ b/docs/2023-07-01-pastebin.html
@@ -394,7 +394,7 @@ rsync -avzP src/ dst
-z
: compress
-P
: enable both --partial
,
- --progress
to easily resume after interupt
+ --progress
to easily resume after interrupt
-n
: dry run
diff --git a/docs/2023-08-23-real-world-crypto.html b/docs/2023-08-23-real-world-crypto.html
index 5674f6a..32cf251 100644
--- a/docs/2023-08-23-real-world-crypto.html
+++ b/docs/2023-08-23-real-world-crypto.html
@@ -123,12 +123,12 @@
counter as mac(secret_key, counter, alice).
- Verify must be done in constant time: if not, probaly
+ Verify must be done in constant time: if not, probably
return error the moment the bytes differ -> attacker recreate byte by
byte by measuring how long -> timing attacks
- Constant time comparision:
+ Constant time comparison:
for i := 0; i < len(x); i++ {
// Use XOR instead of compare x[i] == y[i]
diff --git a/docs/2024-01-20-backend-thinking.html b/docs/2024-01-20-backend-thinking.html
index 23dfbf8..348ef58 100644
--- a/docs/2024-01-20-backend-thinking.html
+++ b/docs/2024-01-20-backend-thinking.html
@@ -239,7 +239,7 @@
Message Broker is a way to detach B from A.
- Dumb exaplain be like: each time A do something, A produces message to
+ Dumb explain be like: each time A do something, A produces message to
Message Broker, than A forgets about it. Then all B1, B2 can consume A's
message if they want and do something with it, A does not know and does
not need to know about it.
@@ -303,7 +303,7 @@
Don't delete/rename/change old fields because you want and you can,
- please think it through before do it. Because back compability is very
+ please think it through before do it. Because back compatibility is very
hard, old apps should continue to function if user don't upgrade. Even
if we rollout new version, it takes time.
diff --git a/posts/2022-07-12-uuid-or-else.md b/posts/2022-07-12-uuid-or-else.md
index ffdce32..3f9918b 100644
--- a/posts/2022-07-12-uuid-or-else.md
+++ b/posts/2022-07-12-uuid-or-else.md
@@ -1,7 +1,7 @@
# UUID or else
There are many use cases where we need to use a unique ID. In my experience, I
-only encouter 2 cases:
+only encounter 2 cases:
- ID to trace request from client to server, from service to service
(microservice architecture or nanoservice I don't know).
@@ -17,7 +17,7 @@ In my Go universe, there are some libs to help us with this:
## First use case is trace ID, or context aware ID
The ID is used only for trace and log. If same ID is generated twice (because
-maybe the possibilty is too small but not 0), honestly I don't care. When I use
+maybe the possibility is too small but not 0), honestly I don't care. When I use
that ID to search log , if it pops more than things I care for, it is still no
harm to me.
diff --git a/posts/2022-07-31-experiment-go.md b/posts/2022-07-31-experiment-go.md
index 64ad716..d6118c8 100644
--- a/posts/2022-07-31-experiment-go.md
+++ b/posts/2022-07-31-experiment-go.md
@@ -57,7 +57,7 @@ This pattern is used by [google/go-github](https://github.com/google/go-github).
## Find alternative to [grpc/grpc-go](https://github.com/grpc/grpc-go)
Why?
-[See for yourself](https://github.com/grpc/grpc-go/issues?q=is%3Aissue+compatibility+is%3Aclosed).
+[See for yourself](https://github.com/grpc/grpc-go/issues?qgis%3Aissue+compatibility+is%3Aclosed).
Also read:
@@ -67,7 +67,7 @@ Also read:
Currently there are some:
-- [bufbuild/connect-go](https://github.com/bufbuild/connect-go). Comming from
+- [bufbuild/connect-go](https://github.com/bufbuild/connect-go). Coming from
buf, trust worthy but need time to make it match feature parity with grpc-go.
- [twitchtv/twirp](https://github.com/twitchtv/twirp)
- [storj/drpc](https://github.com/storj/drpc)
diff --git a/posts/2022-07-31-sql.md b/posts/2022-07-31-sql.md
index 0544983..794ab2b 100644
--- a/posts/2022-07-31-sql.md
+++ b/posts/2022-07-31-sql.md
@@ -15,7 +15,7 @@ sortable.
## Stay away from database timestamp
-Stay away from all kind of database timestamp (MySQL timestmap, SQLite
+Stay away from all kind of database timestamp (MySQL timestamp, SQLite
timestamp, ...) Just use int64 then pass the timestamp in service layer not
database layer.
@@ -106,7 +106,7 @@ FROM table
WHERE (field_something IS NULL OR field_something != 1)
```
-Need clarify why this happpen? Idk :(
+Need clarify why this happen? Idk :(
## `VARCHAR` or `TEXT`
@@ -122,7 +122,7 @@ Prefer `LIMIT 10 OFFSET 5` to `LIMIT 5, 10` to avoid misunderstanding.
## Be super careful when migrate, update database on production and online!!!
-Plase read docs about online ddl operations before do anything online (keep
+Please read docs about online ddl operations before do anything online (keep
database running the same time update it, for example create index, ...)
- [For MySQL 5.7](https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl-operations.html),
diff --git a/posts/2022-12-25-go-test-asap.md b/posts/2022-12-25-go-test-asap.md
index 4a8b1db..55d3eea 100644
--- a/posts/2022-12-25-go-test-asap.md
+++ b/posts/2022-12-25-go-test-asap.md
@@ -12,7 +12,7 @@ coverage, with minimum effort as possible, I hope this will show you some idea
you can use :)
In my opinion, unit test is not that important (like must must have). It's just
-make sure your code is running excatly as you intent it to be. If you don't
+make sure your code is running exactly as you intent it to be. If you don't
think about edge case before, unit test won't help you.
## First, rewrite the impossible (to test) out
@@ -138,7 +138,7 @@ Looks good right? Be careful with this. It can go from 0 to 100 ugly real quick.
What if req is a struct with many fields? So in each test case you need to set
up req. They are almost the same, but with some error case you must alter req.
It's easy to be init with wrong value here (typing maybe ?). Also all req looks
-similiar, kinda duplicated.
+similar, kinda duplicated.
```go
tests := []struct{
diff --git a/posts/2023-03-05-incident.md b/posts/2023-03-05-incident.md
index 9bd6461..71e5093 100644
--- a/posts/2023-03-05-incident.md
+++ b/posts/2023-03-05-incident.md
@@ -38,4 +38,4 @@ one, aka image in submitted data, is gone.
Chaos right there!
**Solution**: Use a lock, if user enter API upload, lock it to prevent user call
-other APIs. Rememeber to unlock after finished
+other APIs. Remember to unlock after finished
diff --git a/posts/2023-04-17-keeb.md b/posts/2023-04-17-keeb.md
index 1b2c1f9..6143839 100644
--- a/posts/2023-04-17-keeb.md
+++ b/posts/2023-04-17-keeb.md
@@ -91,7 +91,7 @@ Review:
Things I don't like:
-- Sandwhich style is meh when typing, so I buy Aluminium case.
+- Sandwich style is meh when typing, so I buy Aluminium case.
- The left sandwich case is so tight to put switch in.
- Sometimes right encoder is not working, I need to plug out and plug in again.
- See
diff --git a/posts/2023-05-03-neovim.md b/posts/2023-05-03-neovim.md
index b767578..36a12b7 100644
--- a/posts/2023-05-03-neovim.md
+++ b/posts/2023-05-03-neovim.md
@@ -46,7 +46,7 @@ Sort lines (after selecting lines):
:sort -u
```
-Reverse lines (after selcting lines):
+Reverse lines (after selecting lines):
```vim
:!tail -r
diff --git a/posts/2023-06-25-useful-tools.md b/posts/2023-06-25-useful-tools.md
index 8525b29..dede897 100644
--- a/posts/2023-06-25-useful-tools.md
+++ b/posts/2023-06-25-useful-tools.md
@@ -1,4 +1,4 @@
-# Userful tools
+# Useful tools
This just a raw list.
@@ -134,7 +134,7 @@ Memory
- https://github.com/CodeEditApp/CodeEdit
- https://github.com/Ranchero-Software/NetNewsWire
-## Developement
+## Development
### Terminal
diff --git a/posts/2023-07-01-pastebin.md b/posts/2023-07-01-pastebin.md
index ac86f68..1f898ce 100644
--- a/posts/2023-07-01-pastebin.md
+++ b/posts/2023-07-01-pastebin.md
@@ -285,7 +285,7 @@ Commonly flags:
- `-v`: verbose
- `-z`: compress
-- `-P`: enable both `--partial`, `--progress` to easily resume after interupt
+- `-P`: enable both `--partial`, `--progress` to easily resume after interrupt
- `-n`: dry run
Be careful flags (need dry run if not sure):
diff --git a/posts/2023-08-23-real-world-crypto.md b/posts/2023-08-23-real-world-crypto.md
index c15a7c2..0c60b3a 100644
--- a/posts/2023-08-23-real-world-crypto.md
+++ b/posts/2023-08-23-real-world-crypto.md
@@ -31,11 +31,11 @@ sequenceDiagram
- Replay attacks: send transaction 2 times with perfectly MAC and u know why ->
instead of mac(secret_key, alice), use **counter** as mac(secret_key, counter,
alice).
-- Verify must be done in **constant time**: if not, probaly return error the
+- Verify must be done in **constant time**: if not, probably return error the
moment the bytes differ -> attacker recreate byte by byte by measuring how
long -> timing attacks
-Constant time comparision:
+Constant time comparison:
```go
for i := 0; i < len(x); i++ {
diff --git a/posts/2024-01-20-backend-thinking.md b/posts/2024-01-20-backend-thinking.md
index fd60cb9..b8ee2ae 100644
--- a/posts/2024-01-20-backend-thinking.md
+++ b/posts/2024-01-20-backend-thinking.md
@@ -101,7 +101,7 @@ Bn, this is so depressed to continue.
Message Broker is a way to detach B from A.
-Dumb exaplain be like: each time A do something, A produces message to Message
+Dumb explain be like: each time A do something, A produces message to Message
Broker, than A forgets about it. Then all B1, B2 can consume A's message if they
want and do something with it, A does not know and does not need to know about
it.
@@ -154,8 +154,8 @@ sequenceDiagram
hacker computer. (Actually we can but this is out of scope, and require lots
of advance work)
- Don't delete/rename/change old fields because you want and you can, please
- think it through before do it. Because back compability is very hard, old apps
- should continue to function if user don't upgrade. Even if we rollout new
+ think it through before do it. Because back compatibility is very hard, old
+ apps should continue to function if user don't upgrade. Even if we rollout new
version, it takes time.
**Pro tip**: Use proto to define models (if you can) to take advantage of