feat: add pyright
parent
e14b0fb3ff
commit
6c4262a7dc
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Backup my way</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-backup-my-way"
|
id="user-content-backup-my-way"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Backup my way"
|
||||||
tabindex="-1"
|
|
||||||
href="#backup-my-way"
|
href="#backup-my-way"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Backup my way
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
First thing first, I want to list my own devices, which I have through the
|
First thing first, I want to list my own devices, which I have through the
|
||||||
years:
|
years:
|
||||||
|
@ -151,16 +151,16 @@
|
||||||
<strong>How to backup</strong>, the second is
|
<strong>How to backup</strong>, the second is
|
||||||
<strong>Recovery strategy</strong>.
|
<strong>Recovery strategy</strong>.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">How to backup</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-how-to-backup"
|
id="user-content-how-to-backup"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: How to backup"
|
||||||
tabindex="-1"
|
|
||||||
href="#how-to-backup"
|
href="#how-to-backup"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>How to backup
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Before I talk about backup, I want to talk about data. In specifically,
|
Before I talk about backup, I want to talk about data. In specifically,
|
||||||
which data should I backup?
|
which data should I backup?
|
||||||
|
@ -260,16 +260,16 @@ restic -r rclone:remote:PrivateData restore latest --target <span class="pl-k">~
|
||||||
<li>Store locally in my laptop</li>
|
<li>Store locally in my laptop</li>
|
||||||
<li>Don't store locally in phone (can not keep track easily)</li>
|
<li>Don't store locally in phone (can not keep track easily)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Backup work related data</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-backup-work-related-data"
|
id="user-content-backup-work-related-data"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Backup work related data"
|
||||||
tabindex="-1"
|
|
||||||
href="#backup-work-related-data"
|
href="#backup-work-related-data"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Backup work related data
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>APIs tools:</p>
|
<p>APIs tools:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -283,16 +283,16 @@ restic -r rclone:remote:PrivateData restore latest --target <span class="pl-k">~
|
||||||
Stay away from Postman, it's lag and you can accidentally upload private
|
Stay away from Postman, it's lag and you can accidentally upload private
|
||||||
data publicly.
|
data publicly.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Recovery strategy</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-recovery-strategy"
|
id="user-content-recovery-strategy"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Recovery strategy"
|
||||||
tabindex="-1"
|
|
||||||
href="#recovery-strategy"
|
href="#recovery-strategy"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Recovery strategy
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
There are many strategies that I process to react as if something strange
|
There are many strategies that I process to react as if something strange
|
||||||
is happening to my devices.
|
is happening to my devices.
|
||||||
|
@ -314,16 +314,16 @@ restic -r rclone:remote:PrivateData restore latest --target <span class="pl-k">~
|
||||||
master password and OTP from Gmail, which I log in previously.
|
master password and OTP from Gmail, which I log in previously.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Misc</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-misc"
|
id="user-content-misc"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Misc"
|
||||||
tabindex="-1"
|
|
||||||
href="#misc"
|
href="#misc"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Misc
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
To backup everything is hard, so keep it simple and only backup important
|
To backup everything is hard, so keep it simple and only backup important
|
||||||
things. Pick one then stay away from other cloud services:
|
things. Pick one then stay away from other cloud services:
|
||||||
|
@ -332,16 +332,16 @@ restic -r rclone:remote:PrivateData restore latest --target <span class="pl-k">~
|
||||||
<li>TODOis, Evernote, ... -> Google Keep / Notion</li>
|
<li>TODOis, Evernote, ... -> Google Keep / Notion</li>
|
||||||
<li>Dropbox, OneDrive, ... -> Google Drive</li>
|
<li>Dropbox, OneDrive, ... -> Google Drive</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">The end</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-the-end"
|
id="user-content-the-end"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: The end"
|
||||||
tabindex="-1"
|
|
||||||
href="#the-end"
|
href="#the-end"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>The end
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>This guide will be updated regularly I promise.</p>
|
<p>This guide will be updated regularly I promise.</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Dockerfile for Go</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-dockerfile-for-go"
|
id="user-content-dockerfile-for-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Dockerfile for Go"
|
||||||
tabindex="-1"
|
|
||||||
href="#dockerfile-for-go"
|
href="#dockerfile-for-go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Dockerfile for Go
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Each time I start a new Go project, I repeat many steps. Like set up
|
Each time I start a new Go project, I repeat many steps. Like set up
|
||||||
<code>.gitignore</code>, CI configs, Dockerfile, ...
|
<code>.gitignore</code>, CI configs, Dockerfile, ...
|
||||||
|
@ -165,16 +165,16 @@
|
||||||
<span class="pl-k">ENTRYPOINT</span> [<span class="pl-s">"/app"</span>]</pre>
|
<span class="pl-k">ENTRYPOINT</span> [<span class="pl-s">"/app"</span>]</pre>
|
||||||
</div>
|
</div>
|
||||||
<p>Finally, I copy <code>app</code> to Distroless base image.</p>
|
<p>Finally, I copy <code>app</code> to Distroless base image.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,32 +28,32 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Bootstrap Go</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-bootstrap-go"
|
id="user-content-bootstrap-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Bootstrap Go"
|
||||||
tabindex="-1"
|
|
||||||
href="#bootstrap-go"
|
href="#bootstrap-go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Bootstrap Go
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
It is hard to write bootstrap tool to quickly create Go service. So I
|
It is hard to write bootstrap tool to quickly create Go service. So I
|
||||||
write this guide instead. This is a quick checklist for me every damn time
|
write this guide instead. This is a quick checklist for me every damn time
|
||||||
I need to write a Go service from scratch. Also, this is my personal
|
I need to write a Go service from scratch. Also, this is my personal
|
||||||
opinion, so feel free to comment.
|
opinion, so feel free to comment.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Structure</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-structure"
|
id="user-content-structure"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Structure"
|
||||||
tabindex="-1"
|
|
||||||
href="#structure"
|
href="#structure"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Structure
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre>
|
<pre>
|
||||||
main.go
|
main.go
|
||||||
|
@ -135,16 +135,16 @@ internal
|
||||||
<code>business</code>.
|
<code>business</code>.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Do not repeat!</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-do-not-repeat"
|
id="user-content-do-not-repeat"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Do not repeat!"
|
||||||
tabindex="-1"
|
|
||||||
href="#do-not-repeat"
|
href="#do-not-repeat"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Do not repeat!
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>If we have too many services, some of the logic will be overlapped.</p>
|
<p>If we have too many services, some of the logic will be overlapped.</p>
|
||||||
<p>
|
<p>
|
||||||
For example, service A and service B both need to make POST call API to
|
For example, service A and service B both need to make POST call API to
|
||||||
|
@ -157,26 +157,26 @@ internal
|
||||||
Another bad practice is adapter service. No need to write a new service if
|
Another bad practice is adapter service. No need to write a new service if
|
||||||
what we need is just common pkg libs.
|
what we need is just common pkg libs.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Taste on style guide</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-taste-on-style-guide"
|
id="user-content-taste-on-style-guide"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Taste on style guide"
|
||||||
tabindex="-1"
|
|
||||||
href="#taste-on-style-guide"
|
href="#taste-on-style-guide"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Taste on style guide
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Stop using global var</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-stop-using-global-var"
|
id="user-content-stop-using-global-var"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Stop using global var"
|
||||||
tabindex="-1"
|
|
||||||
href="#stop-using-global-var"
|
href="#stop-using-global-var"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Stop using global var
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
If I see someone using global var, I swear I will shoot them twice in the
|
If I see someone using global var, I swear I will shoot them twice in the
|
||||||
face.
|
face.
|
||||||
|
@ -186,16 +186,18 @@ internal
|
||||||
<li>Can not write unit test.</li>
|
<li>Can not write unit test.</li>
|
||||||
<li>Is not thread safe.</li>
|
<li>Is not thread safe.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Use functional options, but don't overuse it!
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-use-functional-options-but-dont-overuse-it"
|
id="user-content-use-functional-options-but-dont-overuse-it"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Use functional options, but don't overuse it!"
|
||||||
tabindex="-1"
|
|
||||||
href="#use-functional-options-but-dont-overuse-it"
|
href="#use-functional-options-but-dont-overuse-it"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Use functional options, but don't overuse it!
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
For simple struct with 1 or 2 fields, no need to use functional options.
|
For simple struct with 1 or 2 fields, no need to use functional options.
|
||||||
</p>
|
</p>
|
||||||
|
@ -240,20 +242,22 @@ internal
|
||||||
<code>WithB</code> option. No need to pass direct field inside
|
<code>WithB</code> option. No need to pass direct field inside
|
||||||
<code>s</code>.
|
<code>s</code>.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-use-errgroup-as-much-as-possible"
|
Use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#use-errgroup-as-much-as-possible"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Use
|
|
||||||
<a href="https://pkg.go.dev/golang.org/x/sync/errgroup" rel="nofollow"
|
<a href="https://pkg.go.dev/golang.org/x/sync/errgroup" rel="nofollow"
|
||||||
>errgroup</a
|
>errgroup</a
|
||||||
>
|
>
|
||||||
as much as possible
|
as much as possible
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-use-errgroup-as-much-as-possible"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use errgroup as much as possible"
|
||||||
|
href="#use-errgroup-as-much-as-possible"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
If business logic involves calling too many APIs, but they are not depend
|
If business logic involves calling too many APIs, but they are not depend
|
||||||
on each other. We can fire them parallel :)
|
on each other. We can fire them parallel :)
|
||||||
|
@ -285,36 +289,40 @@ internal
|
||||||
<span class="pl-c">// Handle error</span>
|
<span class="pl-c">// Handle error</span>
|
||||||
}</pre>
|
}</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-use-semaphore-when-need-to-implement-workerpool"
|
Use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#use-semaphore-when-need-to-implement-workerpool"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Use
|
|
||||||
<a href="https://pkg.go.dev/golang.org/x/sync/semaphore" rel="nofollow"
|
<a href="https://pkg.go.dev/golang.org/x/sync/semaphore" rel="nofollow"
|
||||||
>semaphore</a
|
>semaphore</a
|
||||||
>
|
>
|
||||||
when need to implement WorkerPool
|
when need to implement WorkerPool
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-use-semaphore-when-need-to-implement-workerpool"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use semaphore when need to implement WorkerPool"
|
||||||
|
href="#use-semaphore-when-need-to-implement-workerpool"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Please don't use external libs for WorkerPool, I don't want to deal with
|
Please don't use external libs for WorkerPool, I don't want to deal with
|
||||||
dependency hell.
|
dependency hell.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-use-syncpool-when-need-to-reuse-object-mainly-for-bytesbuffer"
|
Use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#use-syncpool-when-need-to-reuse-object-mainly-for-bytesbuffer"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Use
|
|
||||||
<a href="https://pkg.go.dev/sync#Pool" rel="nofollow">sync.Pool</a> when
|
<a href="https://pkg.go.dev/sync#Pool" rel="nofollow">sync.Pool</a> when
|
||||||
need to reuse object, mainly for <code>bytes.Buffer</code>
|
need to reuse object, mainly for <code>bytes.Buffer</code>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-use-syncpool-when-need-to-reuse-object-mainly-for-bytesbuffer"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use sync.Pool when need to reuse object, mainly for bytes.Buffer"
|
||||||
|
href="#use-syncpool-when-need-to-reuse-object-mainly-for-bytesbuffer"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Example:</p>
|
<p>Example:</p>
|
||||||
<div class="highlight highlight-source-go">
|
<div class="highlight highlight-source-go">
|
||||||
<pre><span class="pl-k">var</span> <span class="pl-s1">bufPool</span> <span class="pl-c1">=</span> sync.<span class="pl-smi">Pool</span>{
|
<pre><span class="pl-k">var</span> <span class="pl-s1">bufPool</span> <span class="pl-c1">=</span> sync.<span class="pl-smi">Pool</span>{
|
||||||
|
@ -343,18 +351,21 @@ internal
|
||||||
<span class="pl-k">return</span> <span class="pl-s1">result</span>, <span class="pl-c1">nil</span>
|
<span class="pl-k">return</span> <span class="pl-s1">result</span>, <span class="pl-c1">nil</span>
|
||||||
}</pre>
|
}</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
<a href="https://go.dev/doc/tutorial/generics" rel="nofollow"
|
||||||
|
>Generics</a
|
||||||
|
>
|
||||||
|
with some tricks
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-generics-with-some-tricks"
|
id="user-content-generics-with-some-tricks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Generics with some tricks"
|
||||||
tabindex="-1"
|
|
||||||
href="#generics-with-some-tricks"
|
href="#generics-with-some-tricks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
></a>
|
></a>
|
||||||
<a href="https://go.dev/doc/tutorial/generics" rel="nofollow">Generics</a>
|
</div>
|
||||||
with some tricks
|
|
||||||
</h3>
|
|
||||||
<p>
|
<p>
|
||||||
Take value then return pointer, useful with database struct full of
|
Take value then return pointer, useful with database struct full of
|
||||||
pointers:
|
pointers:
|
||||||
|
@ -372,40 +383,42 @@ internal
|
||||||
<span class="pl-k">return</span> <span class="pl-s1">zero</span>
|
<span class="pl-k">return</span> <span class="pl-s1">zero</span>
|
||||||
}</pre>
|
}</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">External libs</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-external-libs"
|
id="user-content-external-libs"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: External libs"
|
||||||
tabindex="-1"
|
|
||||||
href="#external-libs"
|
href="#external-libs"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>External libs
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">No need <code>vendor</code></h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-no-need-vendor"
|
id="user-content-no-need-vendor"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: No need vendor"
|
||||||
tabindex="-1"
|
|
||||||
href="#no-need-vendor"
|
href="#no-need-vendor"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>No need <code>vendor</code>
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Only need if you need something from <code>vendor</code>, to generate mock
|
Only need if you need something from <code>vendor</code>, to generate mock
|
||||||
or something else.
|
or something else.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Use <code>build.go</code> to include build tools in go.mod
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-use-buildgo-to-include-build-tools-in-gomod"
|
id="user-content-use-buildgo-to-include-build-tools-in-gomod"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Use build.go to include build tools in go.mod"
|
||||||
tabindex="-1"
|
|
||||||
href="#use-buildgo-to-include-build-tools-in-gomod"
|
href="#use-buildgo-to-include-build-tools-in-gomod"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Use <code>build.go</code> to include build tools in go.mod
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>To easily control version of build tools.</p>
|
<p>To easily control version of build tools.</p>
|
||||||
<p>For example <code>build.go</code>:</p>
|
<p>For example <code>build.go</code>:</p>
|
||||||
<div class="highlight highlight-source-go">
|
<div class="highlight highlight-source-go">
|
||||||
|
@ -427,19 +440,21 @@ internal
|
||||||
We always get the version of build tools in <code>go.mod</code> each time
|
We always get the version of build tools in <code>go.mod</code> each time
|
||||||
we install it. Future contributors will not cry anymore.
|
we install it. Future contributors will not cry anymore.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-dont-use-cli-libs-spf13cobra-urfavecli-just-for-go-service"
|
Don't use cli libs (<a href="https://github.com/spf13/cobra"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#dont-use-cli-libs-spf13cobra-urfavecli-just-for-go-service"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Don't use cli libs (<a href="https://github.com/spf13/cobra"
|
|
||||||
>spf13/cobra</a
|
>spf13/cobra</a
|
||||||
>, <a href="https://github.com/urfave/cli">urfave/cli</a>) just for Go
|
>, <a href="https://github.com/urfave/cli">urfave/cli</a>) just for Go
|
||||||
service
|
service
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-dont-use-cli-libs-spf13cobra-urfavecli-just-for-go-service"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Don't use cli libs (spf13/cobra, urfave/cli) just for Go service"
|
||||||
|
href="#dont-use-cli-libs-spf13cobra-urfavecli-just-for-go-service"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
What is the point to pass many params (<code>do-it</code>,
|
What is the point to pass many params (<code>do-it</code>,
|
||||||
<code>--abc</code>, <code>--xyz</code>) when what we only need is start
|
<code>--abc</code>, <code>--xyz</code>) when what we only need is start
|
||||||
|
@ -451,19 +466,21 @@ internal
|
||||||
<a href="https://12factor.net/" rel="nofollow">The Twelve Factors</a>
|
<a href="https://12factor.net/" rel="nofollow">The Twelve Factors</a>
|
||||||
guide.
|
guide.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-dont-use-grpc-ecosystemgrpc-gateway"
|
Don't use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#dont-use-grpc-ecosystemgrpc-gateway"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Don't use
|
|
||||||
<a href="https://github.com/grpc-ecosystem/grpc-gateway"
|
<a href="https://github.com/grpc-ecosystem/grpc-gateway"
|
||||||
>grpc-ecosystem/grpc-gateway</a
|
>grpc-ecosystem/grpc-gateway</a
|
||||||
>
|
>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-dont-use-grpc-ecosystemgrpc-gateway"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Don't use grpc-ecosystem/grpc-gateway"
|
||||||
|
href="#dont-use-grpc-ecosystemgrpc-gateway"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Just don't.</p>
|
<p>Just don't.</p>
|
||||||
<p>
|
<p>
|
||||||
Use
|
Use
|
||||||
|
@ -475,32 +492,37 @@ internal
|
||||||
Write 1 for both gRPC, REST sounds good, but in the end, it is not worth
|
Write 1 for both gRPC, REST sounds good, but in the end, it is not worth
|
||||||
it.
|
it.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Don't use
|
||||||
|
<a href="https://github.com/uber/prototool">uber/prototool</a>, use
|
||||||
|
<a href="https://github.com/bufbuild/buf">bufbuild/buf</a>
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-dont-use-uberprototool-use-bufbuildbuf"
|
id="user-content-dont-use-uberprototool-use-bufbuildbuf"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Don't use uber/prototool, use bufbuild/buf"
|
||||||
tabindex="-1"
|
|
||||||
href="#dont-use-uberprototool-use-bufbuildbuf"
|
href="#dont-use-uberprototool-use-bufbuildbuf"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Don't use <a href="https://github.com/uber/prototool">uber/prototool</a>,
|
></a>
|
||||||
use <a href="https://github.com/bufbuild/buf">bufbuild/buf</a>
|
</div>
|
||||||
</h3>
|
|
||||||
<p>
|
<p>
|
||||||
prototool is deprecated, and buf can generate, lint, format as good as
|
prototool is deprecated, and buf can generate, lint, format as good as
|
||||||
prototool.
|
prototool.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-use-gin-gonicgin-for-rest"
|
Use <a href="https://github.com/gin-gonic/gin">gin-gonic/gin</a> for
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#use-gin-gonicgin-for-rest"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Use <a href="https://github.com/gin-gonic/gin">gin-gonic/gin</a> for
|
|
||||||
REST.
|
REST.
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-use-gin-gonicgin-for-rest"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use gin-gonic/gin for REST."
|
||||||
|
href="#use-gin-gonicgin-for-rest"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>With <code>c *gin.Context</code>:</p>
|
<p>With <code>c *gin.Context</code>:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -520,17 +542,19 @@ internal
|
||||||
}
|
}
|
||||||
}()</pre>
|
}()</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-if-you-want-log-just-use-uber-gozap"
|
If you want log, just use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#if-you-want-log-just-use-uber-gozap"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>If you want log, just use
|
|
||||||
<a href="https://github.com/uber-go/zap">uber-go/zap</a>
|
<a href="https://github.com/uber-go/zap">uber-go/zap</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-if-you-want-log-just-use-uber-gozap"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: If you want log, just use uber-go/zap"
|
||||||
|
href="#if-you-want-log-just-use-uber-gozap"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>It is fast!</p>
|
<p>It is fast!</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -552,17 +576,19 @@ internal
|
||||||
for easily debug.
|
for easily debug.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-to-read-config-use-spf13viper"
|
To read config, use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#to-read-config-use-spf13viper"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>To read config, use
|
|
||||||
<a href="https://github.com/spf13/viper">spf13/viper</a>
|
<a href="https://github.com/spf13/viper">spf13/viper</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-to-read-config-use-spf13viper"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: To read config, use spf13/viper"
|
||||||
|
href="#to-read-config-use-spf13viper"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Only init config in main or cmd layer. Do not use
|
Only init config in main or cmd layer. Do not use
|
||||||
<code>viper.Get...</code> in business layer or inside business layer.
|
<code>viper.Get...</code> in business layer or inside business layer.
|
||||||
|
@ -576,16 +602,18 @@ internal
|
||||||
Also, be careful if config value is empty. You should decide to continue
|
Also, be careful if config value is empty. You should decide to continue
|
||||||
or stop the service if there is empty config.
|
or stop the service if there is empty config.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Don't overuse ORM libs, no need to handle another layer above SQL.
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-dont-overuse-orm-libs-no-need-to-handle-another-layer-above-sql"
|
id="user-content-dont-overuse-orm-libs-no-need-to-handle-another-layer-above-sql"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Don't overuse ORM libs, no need to handle another layer above SQL."
|
||||||
tabindex="-1"
|
|
||||||
href="#dont-overuse-orm-libs-no-need-to-handle-another-layer-above-sql"
|
href="#dont-overuse-orm-libs-no-need-to-handle-another-layer-above-sql"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Don't overuse ORM libs, no need to handle another layer above SQL.
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Each ORM libs has each different syntax. To learn and use those libs
|
Each ORM libs has each different syntax. To learn and use those libs
|
||||||
correctly is time consuming. So just stick to plain SQL. It is easier to
|
correctly is time consuming. So just stick to plain SQL. It is easier to
|
||||||
|
@ -606,17 +634,19 @@ internal
|
||||||
those cases. I hear that
|
those cases. I hear that
|
||||||
<a href="https://github.com/go-gorm/gorm">go-gorm/gorm</a> is good.
|
<a href="https://github.com/go-gorm/gorm">go-gorm/gorm</a> is good.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-connect-redis-with-redisgo-redis"
|
Connect Redis with
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#connect-redis-with-redisgo-redis"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Connect Redis with
|
|
||||||
<a href="https://github.com/redis/go-redis">redis/go-redis</a>
|
<a href="https://github.com/redis/go-redis">redis/go-redis</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-connect-redis-with-redisgo-redis"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Connect Redis with redis/go-redis"
|
||||||
|
href="#connect-redis-with-redisgo-redis"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Be careful when use
|
Be careful when use
|
||||||
<a href="https://redis.io/commands/hgetall/" rel="nofollow">HGETALL</a>.
|
<a href="https://redis.io/commands/hgetall/" rel="nofollow">HGETALL</a>.
|
||||||
|
@ -677,17 +707,19 @@ internal
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>ReadTimeout</code>, <code>WriteTimeout</code></li>
|
<li><code>ReadTimeout</code>, <code>WriteTimeout</code></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-connect-mysql-with-go-sql-drivermysql"
|
Connect MySQL with
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#connect-mysql-with-go-sql-drivermysql"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Connect MySQL with
|
|
||||||
<a href="https://github.com/go-sql-driver/mysql">go-sql-driver/mysql</a>
|
<a href="https://github.com/go-sql-driver/mysql">go-sql-driver/mysql</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-connect-mysql-with-go-sql-drivermysql"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Connect MySQL with go-sql-driver/mysql"
|
||||||
|
href="#connect-mysql-with-go-sql-drivermysql"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Remember to config:</p>
|
<p>Remember to config:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>SetConnMaxLifetime</code></li>
|
<li><code>SetConnMaxLifetime</code></li>
|
||||||
|
@ -698,19 +730,21 @@ internal
|
||||||
<li><code>CheckConnLiveness</code> to true.</li>
|
<li><code>CheckConnLiveness</code> to true.</li>
|
||||||
<li><code>ReadTimeout</code>, <code>WriteTimeout</code></li>
|
<li><code>ReadTimeout</code>, <code>WriteTimeout</code></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-connect-sqlite-with-moderncorgsqlite"
|
Connect SQLite with
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#connect-sqlite-with-moderncorgsqlite"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Connect SQLite with
|
|
||||||
<a href="https://gitlab.com/cznic/sqlite" rel="nofollow"
|
<a href="https://gitlab.com/cznic/sqlite" rel="nofollow"
|
||||||
>modernc.org/sqlite</a
|
>modernc.org/sqlite</a
|
||||||
>
|
>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-connect-sqlite-with-moderncorgsqlite"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Connect SQLite with modernc.org/sqlite"
|
||||||
|
href="#connect-sqlite-with-moderncorgsqlite"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Remember to config:</p>
|
<p>Remember to config:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Write-Ahead Logging: <code>PRAGMA journal_mode=WAL</code></li>
|
<li>Write-Ahead Logging: <code>PRAGMA journal_mode=WAL</code></li>
|
||||||
|
@ -723,16 +757,19 @@ internal
|
||||||
<a href="https://github.com/mattn/go-sqlite3">mattn/go-sqlite3</a>, it's
|
<a href="https://github.com/mattn/go-sqlite3">mattn/go-sqlite3</a>, it's
|
||||||
required <code>CGO_ENABLED</code>.
|
required <code>CGO_ENABLED</code>.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Connect Kafka with
|
||||||
|
<a href="https://github.com/IBM/sarama">IBM/sarama</a>
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-connect-kafka-with-ibmsarama"
|
id="user-content-connect-kafka-with-ibmsarama"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Connect Kafka with IBM/sarama"
|
||||||
tabindex="-1"
|
|
||||||
href="#connect-kafka-with-ibmsarama"
|
href="#connect-kafka-with-ibmsarama"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Connect Kafka with <a href="https://github.com/IBM/sarama">IBM/sarama</a>
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Use <code>sarama.V1_0_0_0</code>, because IBM decide to upgrade default
|
Use <code>sarama.V1_0_0_0</code>, because IBM decide to upgrade default
|
||||||
version.
|
version.
|
||||||
|
@ -743,33 +780,37 @@ internal
|
||||||
>confluentinc/confluent-kafka-go</a
|
>confluentinc/confluent-kafka-go</a
|
||||||
>, it's required <code>CGO_ENABLED</code>.
|
>, it's required <code>CGO_ENABLED</code>.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-if-you-want-test-just-use-stretchrtestify"
|
If you want test, just use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#if-you-want-test-just-use-stretchrtestify"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>If you want test, just use
|
|
||||||
<a href="https://github.com/stretchr/testify">stretchr/testify</a>.
|
<a href="https://github.com/stretchr/testify">stretchr/testify</a>.
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-if-you-want-test-just-use-stretchrtestify"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: If you want test, just use stretchr/testify."
|
||||||
|
href="#if-you-want-test-just-use-stretchrtestify"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
It is easy to write a suite test, thanks to testify. Also, for mocking,
|
It is easy to write a suite test, thanks to testify. Also, for mocking,
|
||||||
there are many options out there. Pick 1 then sleep peacefully.
|
there are many options out there. Pick 1 then sleep peacefully.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-if-need-to-mock-choose-matryermoq-or-ubermock"
|
If need to mock, choose
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#if-need-to-mock-choose-matryermoq-or-ubermock"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>If need to mock, choose
|
|
||||||
<a href="https://github.com/matryer/moq">matryer/moq</a> or
|
<a href="https://github.com/matryer/moq">matryer/moq</a> or
|
||||||
<a href="https://github.com/uber/mock">uber/mock</a>
|
<a href="https://github.com/uber/mock">uber/mock</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-if-need-to-mock-choose-matryermoq-or-ubermock"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: If need to mock, choose matryer/moq or uber/mock"
|
||||||
|
href="#if-need-to-mock-choose-matryermoq-or-ubermock"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
The first is easy to use but not powerful as the later. If you want to
|
The first is easy to use but not powerful as the later. If you want to
|
||||||
make sure mock func is called with correct times, use the later.
|
make sure mock func is called with correct times, use the later.
|
||||||
|
@ -780,16 +821,18 @@ internal
|
||||||
<span class="pl-c">// https://jonwillia.ms/2019/12/22/conditional-gomock-mockgen</span>
|
<span class="pl-c">// https://jonwillia.ms/2019/12/22/conditional-gomock-mockgen</span>
|
||||||
<span class="pl-c">//go:generate sh -c "test service_mock_generated.go -nt $GOFILE && exit 0; moq -rm -out service_mock_generated.go . Service"</span></pre>
|
<span class="pl-c">//go:generate sh -c "test service_mock_generated.go -nt $GOFILE && exit 0; moq -rm -out service_mock_generated.go . Service"</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Be careful with <a href="https://github.com/spf13/cast">spf13/cast</a>
|
||||||
|
</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-be-careful-with-spf13cast"
|
id="user-content-be-careful-with-spf13cast"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Be careful with spf13/cast"
|
||||||
tabindex="-1"
|
|
||||||
href="#be-careful-with-spf13cast"
|
href="#be-careful-with-spf13cast"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Be careful with <a href="https://github.com/spf13/cast">spf13/cast</a>
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>Don't cast proto enum:</p>
|
<p>Don't cast proto enum:</p>
|
||||||
<div class="highlight highlight-source-go">
|
<div class="highlight highlight-source-go">
|
||||||
<pre><span class="pl-c">// Bad</span>
|
<pre><span class="pl-c">// Bad</span>
|
||||||
|
@ -798,15 +841,9 @@ internal
|
||||||
<span class="pl-c">// Good</span>
|
<span class="pl-c">// Good</span>
|
||||||
<span class="pl-s1">a</span> <span class="pl-c1">:=</span> <span class="pl-en">int32</span>(<span class="pl-s1">servicev1</span>.<span class="pl-c1">ReasonCode_ABC</span>)</pre>
|
<span class="pl-s1">a</span> <span class="pl-c1">:=</span> <span class="pl-en">int32</span>(<span class="pl-s1">servicev1</span>.<span class="pl-c1">ReasonCode_ABC</span>)</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-use-stringer-if-you-want-your-type-enum-can-be-print-as-string"
|
Use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#use-stringer-if-you-want-your-type-enum-can-be-print-as-string"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Use
|
|
||||||
<a
|
<a
|
||||||
href="https://pkg.go.dev/golang.org/x/tools/cmd/stringer"
|
href="https://pkg.go.dev/golang.org/x/tools/cmd/stringer"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
|
@ -814,6 +851,14 @@ internal
|
||||||
>
|
>
|
||||||
if you want your type enum can be print as string
|
if you want your type enum can be print as string
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-use-stringer-if-you-want-your-type-enum-can-be-print-as-string"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use stringer if you want your type enum can be print as string"
|
||||||
|
href="#use-stringer-if-you-want-your-type-enum-can-be-print-as-string"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<div class="highlight highlight-source-go">
|
<div class="highlight highlight-source-go">
|
||||||
<pre><span class="pl-k">type</span> <span class="pl-smi">Drink</span> <span class="pl-smi">int</span>
|
<pre><span class="pl-k">type</span> <span class="pl-smi">Drink</span> <span class="pl-smi">int</span>
|
||||||
|
|
||||||
|
@ -829,15 +874,9 @@ internal
|
||||||
<span class="pl-c"><span class="pl-c">#</span> Run inside directory which contains Drink</span>
|
<span class="pl-c"><span class="pl-c">#</span> Run inside directory which contains Drink</span>
|
||||||
stringer -type=Drink</pre>
|
stringer -type=Drink</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-dont-waste-your-time-rewrite-rate-limiter-if-your-use-case-is-simple-use-rate-or-go-redisredis_rate"
|
Don't waste your time rewrite rate limiter if your use case is simple,
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#dont-waste-your-time-rewrite-rate-limiter-if-your-use-case-is-simple-use-rate-or-go-redisredis_rate"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Don't waste your time rewrite rate limiter if your use case is simple,
|
|
||||||
use
|
use
|
||||||
<a href="https://pkg.go.dev/golang.org/x/time/rate" rel="nofollow"
|
<a href="https://pkg.go.dev/golang.org/x/time/rate" rel="nofollow"
|
||||||
>rate</a
|
>rate</a
|
||||||
|
@ -845,36 +884,48 @@ stringer -type=Drink</pre>
|
||||||
or
|
or
|
||||||
<a href="https://github.com/go-redis/redis_rate">go-redis/redis_rate</a>
|
<a href="https://github.com/go-redis/redis_rate">go-redis/redis_rate</a>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-dont-waste-your-time-rewrite-rate-limiter-if-your-use-case-is-simple-use-rate-or-go-redisredis_rate"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Don't waste your time rewrite rate limiter if your use case is simple, use rate or go-redis/redis_rate"
|
||||||
|
href="#dont-waste-your-time-rewrite-rate-limiter-if-your-use-case-is-simple-use-rate-or-go-redisredis_rate"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<strong>rate</strong> if you want rate limiter locally in your single
|
<strong>rate</strong> if you want rate limiter locally in your single
|
||||||
instance of service. <strong>redis_rate</strong> if you want rate limiter
|
instance of service. <strong>redis_rate</strong> if you want rate limiter
|
||||||
distributed across all your instances of service.
|
distributed across all your instances of service.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-replace-go-fmt-goimports-with-mvdangofumpt"
|
Replace <code>go fmt</code>, <code>goimports</code> with
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#replace-go-fmt-goimports-with-mvdangofumpt"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Replace <code>go fmt</code>, <code>goimports</code> with
|
|
||||||
<a href="https://github.com/mvdan/gofumpt">mvdan/gofumpt</a>.
|
<a href="https://github.com/mvdan/gofumpt">mvdan/gofumpt</a>.
|
||||||
</h3>
|
</h3>
|
||||||
<p><code>gofumpt</code> provides more rules when format Go codes.</p>
|
|
||||||
<h3>
|
|
||||||
<a
|
<a
|
||||||
id="user-content-use-golangcigolangci-lint"
|
id="user-content-replace-go-fmt-goimports-with-mvdangofumpt"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Replace go fmt, goimports with mvdan/gofumpt."
|
||||||
tabindex="-1"
|
href="#replace-go-fmt-goimports-with-mvdangofumpt"
|
||||||
href="#use-golangcigolangci-lint"
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
></a>
|
||||||
>Use
|
</div>
|
||||||
|
<p><code>gofumpt</code> provides more rules when format Go codes.</p>
|
||||||
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
Use
|
||||||
<a href="https://github.com/golangci/golangci-lint"
|
<a href="https://github.com/golangci/golangci-lint"
|
||||||
>golangci/golangci-lint</a
|
>golangci/golangci-lint</a
|
||||||
>.
|
>.
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-use-golangcigolangci-lint"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use golangci/golangci-lint."
|
||||||
|
href="#use-golangcigolangci-lint"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>No need to say more. Lint or get the f out!</p>
|
<p>No need to say more. Lint or get the f out!</p>
|
||||||
<p>
|
<p>
|
||||||
If you get <code>fieldalignment</code> error, use
|
If you get <code>fieldalignment</code> error, use
|
||||||
|
@ -892,16 +943,16 @@ go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignme
|
||||||
<span class="pl-c"><span class="pl-c">#</span> Fix</span>
|
<span class="pl-c"><span class="pl-c">#</span> Fix</span>
|
||||||
fieldalignment -fix ./internal/business/<span class="pl-k">*</span>.go</pre>
|
fieldalignment -fix ./internal/business/<span class="pl-k">*</span>.go</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Snippet/script</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-snippetscript"
|
id="user-content-snippetscript"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Snippet/script"
|
||||||
tabindex="-1"
|
|
||||||
href="#snippetscript"
|
href="#snippetscript"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Snippet/script
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Change import:</p>
|
<p>Change import:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>gofmt -w -r <span class="pl-s"><span class="pl-pds">'</span>"github.com/Sirupsen/logrus" -> "github.com/sirupsen/logrus"<span class="pl-pds">'</span></span> <span class="pl-k">*</span>.go</pre>
|
<pre>gofmt -w -r <span class="pl-s"><span class="pl-pds">'</span>"github.com/Sirupsen/logrus" -> "github.com/sirupsen/logrus"<span class="pl-pds">'</span></span> <span class="pl-k">*</span>.go</pre>
|
||||||
|
@ -910,16 +961,16 @@ fieldalignment -fix ./internal/business/<span class="pl-k">*</span>.go</pre>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>go clean -cache -testcache -modcache -fuzzcache -x</pre>
|
<pre>go clean -cache -testcache -modcache -fuzzcache -x</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">UUID or else</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-uuid-or-else"
|
id="user-content-uuid-or-else"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: UUID or else"
|
||||||
tabindex="-1"
|
|
||||||
href="#uuid-or-else"
|
href="#uuid-or-else"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>UUID or else
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
There are many use cases where we need to use a unique ID. In my
|
There are many use cases where we need to use a unique ID. In my
|
||||||
experience, I only encouter 2 cases:
|
experience, I only encouter 2 cases:
|
||||||
|
@ -56,16 +56,18 @@
|
||||||
<li><a href="https://github.com/segmentio/ksuid">segmentio/ksuid</a></li>
|
<li><a href="https://github.com/segmentio/ksuid">segmentio/ksuid</a></li>
|
||||||
<li><a href="https://github.com/oklog/ulid">oklog/ulid</a></li>
|
<li><a href="https://github.com/oklog/ulid">oklog/ulid</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
First use case is trace ID, or context aware ID
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-first-use-case-is-trace-id-or-context-aware-id"
|
id="user-content-first-use-case-is-trace-id-or-context-aware-id"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: First use case is trace ID, or context aware ID"
|
||||||
tabindex="-1"
|
|
||||||
href="#first-use-case-is-trace-id-or-context-aware-id"
|
href="#first-use-case-is-trace-id-or-context-aware-id"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>First use case is trace ID, or context aware ID
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
The ID is used only for trace and log. If same ID is generated twice
|
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 possibilty is too small but not 0), honestly I don't
|
||||||
|
@ -76,16 +78,18 @@
|
||||||
My choice for this use case is <strong>rs/xid</strong>. Because it is
|
My choice for this use case is <strong>rs/xid</strong>. Because it is
|
||||||
small (not span too much on log line) and copy friendly.
|
small (not span too much on log line) and copy friendly.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
Second use case is primary key, also hard choice
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-second-use-case-is-primary-key-also-hard-choice"
|
id="user-content-second-use-case-is-primary-key-also-hard-choice"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Second use case is primary key, also hard choice"
|
||||||
tabindex="-1"
|
|
||||||
href="#second-use-case-is-primary-key-also-hard-choice"
|
href="#second-use-case-is-primary-key-also-hard-choice"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Second use case is primary key, also hard choice
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Why I don't use auto increment key for primary key? The answer is simple,
|
Why I don't use auto increment key for primary key? The answer is simple,
|
||||||
I don't want to write database specific SQL. SQLite has some different
|
I don't want to write database specific SQL. SQLite has some different
|
||||||
|
@ -101,30 +105,30 @@
|
||||||
database is sensitive subject, and I need more testing and battle test
|
database is sensitive subject, and I need more testing and battle test
|
||||||
proof to trust those libs.
|
proof to trust those libs.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">What else?</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-what-else"
|
id="user-content-what-else"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: What else?"
|
||||||
tabindex="-1"
|
|
||||||
href="#what-else"
|
href="#what-else"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>What else?
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
I think about adding prefix to ID to identify which resource that ID
|
I think about adding prefix to ID to identify which resource that ID
|
||||||
represents.
|
represents.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,16 +28,18 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">
|
||||||
|
Migrate to <code>buf</code> from <code>prototool</code>
|
||||||
|
</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-migrate-to-buf-from-prototool"
|
id="user-content-migrate-to-buf-from-prototool"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Migrate to buf from prototool"
|
||||||
tabindex="-1"
|
|
||||||
href="#migrate-to-buf-from-prototool"
|
href="#migrate-to-buf-from-prototool"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Migrate to <code>buf</code> from <code>prototool</code>
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Why? Because <code>prototool</code> is outdated, and can not run on M1
|
Why? Because <code>prototool</code> is outdated, and can not run on M1
|
||||||
mac.
|
mac.
|
||||||
|
@ -146,16 +148,16 @@
|
||||||
sed -i "" -e "s/import \"marshal-zap\.proto\";//g" ./raw/api.proto
|
sed -i "" -e "s/import \"marshal-zap\.proto\";//g" ./raw/api.proto
|
||||||
sed -i "" -e "s/\[(marshal_zap\.mask) = true]//g" ./raw/api.proto</pre>
|
sed -i "" -e "s/\[(marshal_zap\.mask) = true]//g" ./raw/api.proto</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">FAQ</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-faq"
|
id="user-content-faq"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: FAQ"
|
||||||
tabindex="-1"
|
|
||||||
href="#faq"
|
href="#faq"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>FAQ
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Remember <code>bufbuild/protoc-gen-validate</code>,
|
Remember <code>bufbuild/protoc-gen-validate</code>,
|
||||||
<code>kei2100/protoc-gen-marshal-zap</code>,
|
<code>kei2100/protoc-gen-marshal-zap</code>,
|
||||||
|
@ -204,16 +206,16 @@
|
||||||
compatibility.
|
compatibility.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Tips</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-tips"
|
id="user-content-tips"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Tips"
|
||||||
tabindex="-1"
|
|
||||||
href="#tips"
|
href="#tips"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Tips
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>Some experience I got after writing proto files for a living:</p>
|
<p>Some experience I got after writing proto files for a living:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -225,16 +227,16 @@
|
||||||
<code>sed</code> to fix the damn things.
|
<code>sed</code> to fix the damn things.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/uber/prototool">uber/prototool</a></li>
|
<li><a href="https://github.com/uber/prototool">uber/prototool</a></li>
|
||||||
<li><a href="https://github.com/bufbuild/buf">bufbuild/buf</a></li>
|
<li><a href="https://github.com/bufbuild/buf">bufbuild/buf</a></li>
|
||||||
|
|
|
@ -28,30 +28,32 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Experiment Go</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-experiment-go"
|
id="user-content-experiment-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Experiment Go"
|
||||||
tabindex="-1"
|
|
||||||
href="#experiment-go"
|
href="#experiment-go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Experiment Go
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
There come a time when you need to experiment new things, new style, new
|
There come a time when you need to experiment new things, new style, new
|
||||||
approach. So this post serves as it is named.
|
approach. So this post serves as it is named.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
Design API by trimming down the interface/struct or whatever
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-design-api-by-trimming-down-the-interfacestruct-or-whatever"
|
id="user-content-design-api-by-trimming-down-the-interfacestruct-or-whatever"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Design API by trimming down the interface/struct or whatever"
|
||||||
tabindex="-1"
|
|
||||||
href="#design-api-by-trimming-down-the-interfacestruct-or-whatever"
|
href="#design-api-by-trimming-down-the-interfacestruct-or-whatever"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Design API by trimming down the interface/struct or whatever
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Instead of:</p>
|
<p>Instead of:</p>
|
||||||
<div class="highlight highlight-source-go">
|
<div class="highlight highlight-source-go">
|
||||||
<pre><span class="pl-k">type</span> <span class="pl-smi">Client</span> <span class="pl-k">interface</span> {
|
<pre><span class="pl-k">type</span> <span class="pl-smi">Client</span> <span class="pl-k">interface</span> {
|
||||||
|
@ -104,17 +106,19 @@
|
||||||
This pattern is used by
|
This pattern is used by
|
||||||
<a href="https://github.com/google/go-github">google/go-github</a>.
|
<a href="https://github.com/google/go-github">google/go-github</a>.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-find-alternative-to-grpcgrpc-go"
|
Find alternative to
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#find-alternative-to-grpcgrpc-go"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Find alternative to
|
|
||||||
<a href="https://github.com/grpc/grpc-go">grpc/grpc-go</a>
|
<a href="https://github.com/grpc/grpc-go">grpc/grpc-go</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-find-alternative-to-grpcgrpc-go"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Find alternative to grpc/grpc-go"
|
||||||
|
href="#find-alternative-to-grpcgrpc-go"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Why?
|
Why?
|
||||||
<a
|
<a
|
||||||
|
@ -146,16 +150,16 @@
|
||||||
<li><a href="https://github.com/twitchtv/twirp">twitchtv/twirp</a></li>
|
<li><a href="https://github.com/twitchtv/twirp">twitchtv/twirp</a></li>
|
||||||
<li><a href="https://github.com/storj/drpc">storj/drpc</a></li>
|
<li><a href="https://github.com/storj/drpc">storj/drpc</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Thanks</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">SQL</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-sql"
|
id="user-content-sql"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: SQL"
|
||||||
tabindex="-1"
|
|
||||||
href="#sql"
|
href="#sql"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>SQL
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Previously in my fresher software developer time, I rarely write SQL, I
|
Previously in my fresher software developer time, I rarely write SQL, I
|
||||||
always use ORM to wrap SQL. But time past and too much abstraction bites
|
always use ORM to wrap SQL. But time past and too much abstraction bites
|
||||||
|
@ -48,30 +48,30 @@
|
||||||
This guide is not kind of guide which cover all cases. Just my little
|
This guide is not kind of guide which cover all cases. Just my little
|
||||||
tricks when I work with SQL.
|
tricks when I work with SQL.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Stay away from database unique id</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-stay-away-from-database-unique-id"
|
id="user-content-stay-away-from-database-unique-id"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Stay away from database unique id"
|
||||||
tabindex="-1"
|
|
||||||
href="#stay-away-from-database-unique-id"
|
href="#stay-away-from-database-unique-id"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Stay away from database unique id
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Use UUID instead. If you can, and you should, choose UUID type which can
|
Use UUID instead. If you can, and you should, choose UUID type which can
|
||||||
be sortable.
|
be sortable.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Stay away from database timestamp</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-stay-away-from-database-timestamp"
|
id="user-content-stay-away-from-database-timestamp"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Stay away from database timestamp"
|
||||||
tabindex="-1"
|
|
||||||
href="#stay-away-from-database-timestamp"
|
href="#stay-away-from-database-timestamp"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Stay away from database timestamp
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Stay away from all kind of database timestamp (MySQL timestmap, SQLite
|
Stay away from all kind of database timestamp (MySQL timestmap, SQLite
|
||||||
timestamp, ...) Just use int64 then pass the timestamp in service layer
|
timestamp, ...) Just use int64 then pass the timestamp in service layer
|
||||||
|
@ -89,16 +89,16 @@
|
||||||
[Business] time, data -> convert to unix timestamp milliseconds -> [Database] int64</pre
|
[Business] time, data -> convert to unix timestamp milliseconds -> [Database] int64</pre
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Extra field for extra things</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-extra-field-for-extra-things"
|
id="user-content-extra-field-for-extra-things"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Extra field for extra things"
|
||||||
tabindex="-1"
|
|
||||||
href="#extra-field-for-extra-things"
|
href="#extra-field-for-extra-things"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Extra field for extra things
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Create new column in database is scary, so I suggest avoid it if you can.
|
Create new column in database is scary, so I suggest avoid it if you can.
|
||||||
How to avoid, first design table with extra field. It is black hole, put
|
How to avoid, first design table with extra field. It is black hole, put
|
||||||
|
@ -126,16 +126,16 @@
|
||||||
Use <code>JSON_EXTRACT(col, '$.key') IS NULL</code> to check json field
|
Use <code>JSON_EXTRACT(col, '$.key') IS NULL</code> to check json field
|
||||||
exist or not.
|
exist or not.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Use index!!!</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-use-index"
|
id="user-content-use-index"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Use index!!!"
|
||||||
tabindex="-1"
|
|
||||||
href="#use-index"
|
href="#use-index"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Use index!!!
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
You should use index for faster query, but not too much. Don't create
|
You should use index for faster query, but not too much. Don't create
|
||||||
index for every fields in table. Choose wisely!
|
index for every fields in table. Choose wisely!
|
||||||
|
@ -177,16 +177,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Be careful with UTF-8</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-be-careful-with-utf-8"
|
id="user-content-be-careful-with-utf-8"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Be careful with UTF-8"
|
||||||
tabindex="-1"
|
|
||||||
href="#be-careful-with-utf-8"
|
href="#be-careful-with-utf-8"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Be careful with UTF-8
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>TLDR with MySQL:</p>
|
<p>TLDR with MySQL:</p>
|
||||||
<div class="highlight highlight-source-sql">
|
<div class="highlight highlight-source-sql">
|
||||||
<pre><span class="pl-k">CREATE</span> <span class="pl-k">TABLE</span> <span class="pl-en">ekyc_approved</span>
|
<pre><span class="pl-k">CREATE</span> <span class="pl-k">TABLE</span> <span class="pl-en">ekyc_approved</span>
|
||||||
|
@ -196,16 +196,16 @@
|
||||||
) ENGINE <span class="pl-k">=</span> InnoDB
|
) ENGINE <span class="pl-k">=</span> InnoDB
|
||||||
DEFAULT CHARSET <span class="pl-k">=</span> utf8mb4;</pre>
|
DEFAULT CHARSET <span class="pl-k">=</span> utf8mb4;</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Be careful with NULL</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-be-careful-with-null"
|
id="user-content-be-careful-with-null"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Be careful with NULL"
|
||||||
tabindex="-1"
|
|
||||||
href="#be-careful-with-null"
|
href="#be-careful-with-null"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Be careful with NULL
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
If compare with field which can be NULL, remember to check NULL for
|
If compare with field which can be NULL, remember to check NULL for
|
||||||
safety.
|
safety.
|
||||||
|
@ -224,47 +224,48 @@ SELECT <span class="pl-k">*</span>
|
||||||
<span class="pl-k">WHERE</span> (field_something IS <span class="pl-k">NULL</span> <span class="pl-k">OR</span> field_something <span class="pl-k">!=</span> <span class="pl-c1">1</span>)</pre>
|
<span class="pl-k">WHERE</span> (field_something IS <span class="pl-k">NULL</span> <span class="pl-k">OR</span> field_something <span class="pl-k">!=</span> <span class="pl-c1">1</span>)</pre>
|
||||||
</div>
|
</div>
|
||||||
<p>Need clarify why this happpen? Idk :(</p>
|
<p>Need clarify why this happpen? Idk :(</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element"><code>VARCHAR</code> or <code>TEXT</code></h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-varchar-or-text"
|
id="user-content-varchar-or-text"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: VARCHAR or TEXT"
|
||||||
tabindex="-1"
|
|
||||||
href="#varchar-or-text"
|
href="#varchar-or-text"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
></a>
|
></a>
|
||||||
<code>VARCHAR</code> or <code>TEXT</code>
|
</div>
|
||||||
</h2>
|
|
||||||
<p>
|
<p>
|
||||||
Prefer <code>VARCHAR</code> if you need to query and of course use index,
|
Prefer <code>VARCHAR</code> if you need to query and of course use index,
|
||||||
and make sure size of value will never hit the limit. Prefer
|
and make sure size of value will never hit the limit. Prefer
|
||||||
<code>TEXT</code> if you don't care, just want to store something.
|
<code>TEXT</code> if you don't care, just want to store something.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element"><code>LIMIT</code></h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-limit"
|
id="user-content-limit"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: LIMIT"
|
||||||
tabindex="-1"
|
|
||||||
href="#limit"
|
href="#limit"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><code>LIMIT</code>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Prefer <code>LIMIT 10 OFFSET 5</code> to <code>LIMIT 5, 10</code> to avoid
|
Prefer <code>LIMIT 10 OFFSET 5</code> to <code>LIMIT 5, 10</code> to avoid
|
||||||
misunderstanding.
|
misunderstanding.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-be-super-careful-when-migrate-update-database-on-production-and-online"
|
Be super careful when migrate, update database on production and
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#be-super-careful-when-migrate-update-database-on-production-and-online"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Be super careful when migrate, update database on production and
|
|
||||||
online!!!
|
online!!!
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-be-super-careful-when-migrate-update-database-on-production-and-online"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Be super careful when migrate, update database on production and online!!!"
|
||||||
|
href="#be-super-careful-when-migrate-update-database-on-production-and-online"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Plase read docs about online ddl operations before do anything online
|
Plase read docs about online ddl operations before do anything online
|
||||||
(keep database running the same time update it, for example create index,
|
(keep database running the same time update it, for example create index,
|
||||||
|
@ -296,27 +297,27 @@ SELECT <span class="pl-k">*</span>
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Heathcheck</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-heathcheck"
|
id="user-content-heathcheck"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Heathcheck"
|
||||||
tabindex="-1"
|
|
||||||
href="#heathcheck"
|
href="#heathcheck"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Heathcheck
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Use <code>SELECT 1</code> to check if database failed yet.</p>
|
<p>Use <code>SELECT 1</code> to check if database failed yet.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Tools</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-tools"
|
id="user-content-tools"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Tools"
|
||||||
tabindex="-1"
|
|
||||||
href="#tools"
|
href="#tools"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Tools
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Use
|
Use
|
||||||
|
@ -328,16 +329,16 @@ SELECT <span class="pl-k">*</span>
|
||||||
database reality :)
|
database reality :)
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://use-the-index-luke.com/" rel="nofollow"
|
<a href="https://use-the-index-luke.com/" rel="nofollow"
|
||||||
|
|
|
@ -28,27 +28,27 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">gitignore</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-gitignore"
|
id="user-content-gitignore"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: gitignore"
|
||||||
tabindex="-1"
|
|
||||||
href="#gitignore"
|
href="#gitignore"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>gitignore
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>My quick check for <code>.gitignore</code>.</p>
|
<p>My quick check for <code>.gitignore</code>.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Base</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-base"
|
id="user-content-base"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Base"
|
||||||
tabindex="-1"
|
|
||||||
href="#base"
|
href="#base"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Base
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre><span class="pl-c"># macOS</span>
|
<pre><span class="pl-c"># macOS</span>
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
@ -62,16 +62,16 @@
|
||||||
<span class="pl-c"># VSCode</span>
|
<span class="pl-c"># VSCode</span>
|
||||||
.vscode/</pre>
|
.vscode/</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Go</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-go"
|
id="user-content-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Go"
|
||||||
tabindex="-1"
|
|
||||||
href="#go"
|
href="#go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Go
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre><span class="pl-c"># Go</span>
|
<pre><span class="pl-c"># Go</span>
|
||||||
<span class="pl-c"># Test coverage</span>
|
<span class="pl-c"># Test coverage</span>
|
||||||
|
@ -80,16 +80,16 @@ coverage.out
|
||||||
<span class="pl-c"># Should ignore vendor</span>
|
<span class="pl-c"># Should ignore vendor</span>
|
||||||
vendor</pre>
|
vendor</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Python</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-python"
|
id="user-content-python"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Python"
|
||||||
tabindex="-1"
|
|
||||||
href="#python"
|
href="#python"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Python
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-text-adblock"><pre>venv</pre></div>
|
<div class="highlight highlight-text-adblock"><pre>venv</pre></div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Reload config</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-reload-config"
|
id="user-content-reload-config"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Reload config"
|
||||||
tabindex="-1"
|
|
||||||
href="#reload-config"
|
href="#reload-config"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Reload config
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>This serves as design draft of reload config system</p>
|
<p>This serves as design draft of reload config system</p>
|
||||||
<div class="highlight highlight-source-wsd">
|
<div class="highlight highlight-source-wsd">
|
||||||
<pre><span class="pl-k">@startuml</span> Reload config
|
<pre><span class="pl-k">@startuml</span> Reload config
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Install Arch Linux</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-install-arch-linux"
|
id="user-content-install-arch-linux"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Install Arch Linux"
|
||||||
tabindex="-1"
|
|
||||||
href="#install-arch-linux"
|
href="#install-arch-linux"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Install Arch Linux
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Install Arch Linux is thing I always want to do for my laptop/PC since I
|
Install Arch Linux is thing I always want to do for my laptop/PC since I
|
||||||
had my laptop in ninth grade.
|
had my laptop in ninth grade.
|
||||||
|
@ -46,30 +46,32 @@
|
||||||
This is not a guide for everyone, this is just save for myself in a future
|
This is not a guide for everyone, this is just save for myself in a future
|
||||||
and for anyone who want to walk in my shoes.
|
and for anyone who want to walk in my shoes.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
<a
|
<a
|
||||||
id="user-content-installation-guide"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#installation-guide"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a
|
|
||||||
href="https://wiki.archlinux.org/index.php/Installation_guide"
|
href="https://wiki.archlinux.org/index.php/Installation_guide"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
>Installation guide</a
|
>Installation guide</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
<h3>
|
<a
|
||||||
|
id="user-content-installation-guide"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Installation guide"
|
||||||
|
href="#installation-guide"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Pre-installation</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-pre-installation"
|
id="user-content-pre-installation"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Pre-installation"
|
||||||
tabindex="-1"
|
|
||||||
href="#pre-installation"
|
href="#pre-installation"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Pre-installation
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>Check disks carefully:</p>
|
<p>Check disks carefully:</p>
|
||||||
<div class="highlight highlight-source-shell"><pre>lsblk</pre></div>
|
<div class="highlight highlight-source-shell"><pre>lsblk</pre></div>
|
||||||
<p>
|
<p>
|
||||||
|
@ -79,44 +81,44 @@
|
||||||
>USB flash installation medium</a
|
>USB flash installation medium</a
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Verify the boot mode</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-verify-the-boot-mode"
|
id="user-content-verify-the-boot-mode"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Verify the boot mode"
|
||||||
tabindex="-1"
|
|
||||||
href="#verify-the-boot-mode"
|
href="#verify-the-boot-mode"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Verify the boot mode
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<p>Check UEFI mode:</p>
|
<p>Check UEFI mode:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>ls /sys/firmware/efi/efivars</pre>
|
<pre>ls /sys/firmware/efi/efivars</pre>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Connect to the internet</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-connect-to-the-internet"
|
id="user-content-connect-to-the-internet"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Connect to the internet"
|
||||||
tabindex="-1"
|
|
||||||
href="#connect-to-the-internet"
|
href="#connect-to-the-internet"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Connect to the internet
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
For wifi, use
|
For wifi, use
|
||||||
<a href="https://wiki.archlinux.org/index.php/Iwd" rel="nofollow">iwd</a>.
|
<a href="https://wiki.archlinux.org/index.php/Iwd" rel="nofollow">iwd</a>.
|
||||||
</p>
|
</p>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Partition the disks</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-partition-the-disks"
|
id="user-content-partition-the-disks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Partition the disks"
|
||||||
tabindex="-1"
|
|
||||||
href="#partition-the-disks"
|
href="#partition-the-disks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Partition the disks
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://wiki.archlinux.org/index.php/GPT_fdisk" rel="nofollow"
|
<a href="https://wiki.archlinux.org/index.php/GPT_fdisk" rel="nofollow"
|
||||||
>GPT fdisk</a
|
>GPT fdisk</a
|
||||||
|
@ -240,16 +242,16 @@ mount --mkdir /dev/efi_system_partition /mnt/efi
|
||||||
<span class="pl-c"><span class="pl-c">#</span> boot</span>
|
<span class="pl-c"><span class="pl-c">#</span> boot</span>
|
||||||
mount --mkdir /dev/extended_boot_loader_partition /mnt/boot</pre>
|
mount --mkdir /dev/extended_boot_loader_partition /mnt/boot</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Installation</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-installation"
|
id="user-content-installation"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Installation"
|
||||||
tabindex="-1"
|
|
||||||
href="#installation"
|
href="#installation"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Installation
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacstrap -K /mnt base linux linux-firmware
|
<pre>pacstrap -K /mnt base linux linux-firmware
|
||||||
|
|
||||||
|
@ -268,54 +270,56 @@ pacstrap -K /mnt lvm2
|
||||||
<span class="pl-c"><span class="pl-c">#</span> Text editor</span>
|
<span class="pl-c"><span class="pl-c">#</span> Text editor</span>
|
||||||
pacstrap -K /mnt neovim</pre>
|
pacstrap -K /mnt neovim</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Configure</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-configure"
|
id="user-content-configure"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Configure"
|
||||||
tabindex="-1"
|
|
||||||
href="#configure"
|
href="#configure"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Configure
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
<a
|
<h4 class="heading-element">
|
||||||
id="user-content-fstab"
|
<a href="https://wiki.archlinux.org/index.php/Fstab" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#fstab"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://wiki.archlinux.org/index.php/Fstab" rel="nofollow"
|
|
||||||
>fstab</a
|
>fstab</a
|
||||||
>
|
>
|
||||||
</h4>
|
</h4>
|
||||||
|
<a
|
||||||
|
id="user-content-fstab"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: fstab"
|
||||||
|
href="#fstab"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>genfstab -U /mnt <span class="pl-k">>></span> /mnt/etc/fstab</pre>
|
<pre>genfstab -U /mnt <span class="pl-k">>></span> /mnt/etc/fstab</pre>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Chroot</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-chroot"
|
id="user-content-chroot"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Chroot"
|
||||||
tabindex="-1"
|
|
||||||
href="#chroot"
|
href="#chroot"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Chroot
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>arch-chroot /mnt</pre>
|
<pre>arch-chroot /mnt</pre>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Time zone</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-time-zone"
|
id="user-content-time-zone"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Time zone"
|
||||||
tabindex="-1"
|
|
||||||
href="#time-zone"
|
href="#time-zone"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Time zone
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>
|
<pre>
|
||||||
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
|
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
|
||||||
|
@ -323,16 +327,16 @@ ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
|
||||||
hwclock --systohc</pre
|
hwclock --systohc</pre
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Localization:</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-localization"
|
id="user-content-localization"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Localization:"
|
||||||
tabindex="-1"
|
|
||||||
href="#localization"
|
href="#localization"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Localization:
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<p>Edit <code>/etc/locale.gen</code>:</p>
|
<p>Edit <code>/etc/locale.gen</code>:</p>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre><span class="pl-c"># Uncomment en_US.UTF-8 UTF-8</span></pre>
|
<pre><span class="pl-c"># Uncomment en_US.UTF-8 UTF-8</span></pre>
|
||||||
|
@ -343,28 +347,28 @@ hwclock --systohc</pre
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre>LANG=en_US.UTF-8</pre>
|
<pre>LANG=en_US.UTF-8</pre>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Network configuration</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-network-configuration"
|
id="user-content-network-configuration"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Network configuration"
|
||||||
tabindex="-1"
|
|
||||||
href="#network-configuration"
|
href="#network-configuration"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Network configuration
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<p>Edit <code>/etc/hostname</code>:</p>
|
<p>Edit <code>/etc/hostname</code>:</p>
|
||||||
<div class="highlight highlight-text-adblock"><pre>myhostname</pre></div>
|
<div class="highlight highlight-text-adblock"><pre>myhostname</pre></div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Initramfs</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-initramfs"
|
id="user-content-initramfs"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Initramfs"
|
||||||
tabindex="-1"
|
|
||||||
href="#initramfs"
|
href="#initramfs"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Initramfs
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<p>Edit <code>/etc/mkinitcpio.conf</code>:</p>
|
<p>Edit <code>/etc/mkinitcpio.conf</code>:</p>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre><span class="pl-c"># LVM</span>
|
<pre><span class="pl-c"># LVM</span>
|
||||||
|
@ -375,39 +379,41 @@ HOOKS=(base udev ... block lvm2 filesystems)
|
||||||
<span class="pl-c"># Replace udev with systemd</span></pre>
|
<span class="pl-c"># Replace udev with systemd</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="highlight highlight-source-shell"><pre>mkinitcpio -P</pre></div>
|
<div class="highlight highlight-source-shell"><pre>mkinitcpio -P</pre></div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Root password</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-root-password"
|
id="user-content-root-password"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Root password"
|
||||||
tabindex="-1"
|
|
||||||
href="#root-password"
|
href="#root-password"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Root password
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<div class="highlight highlight-source-shell"><pre>passwd</pre></div>
|
<div class="highlight highlight-source-shell"><pre>passwd</pre></div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Addition</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-addition"
|
id="user-content-addition"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Addition"
|
||||||
tabindex="-1"
|
|
||||||
href="#addition"
|
href="#addition"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Addition
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<h5>
|
<div class="markdown-heading">
|
||||||
<a
|
<h5 class="heading-element">
|
||||||
id="user-content-networkmanager-wip"
|
<a href="https://wiki.archlinux.org/title/NetworkManager" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#networkmanager-wip"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://wiki.archlinux.org/title/NetworkManager" rel="nofollow"
|
|
||||||
>NetworkManager (WIP)</a
|
>NetworkManager (WIP)</a
|
||||||
>
|
>
|
||||||
</h5>
|
</h5>
|
||||||
|
<a
|
||||||
|
id="user-content-networkmanager-wip"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: NetworkManager (WIP)"
|
||||||
|
href="#networkmanager-wip"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacman -Syu networkmanager dhcpcd iwd
|
<pre>pacman -Syu networkmanager dhcpcd iwd
|
||||||
systemctl <span class="pl-c1">enable</span> NetworkManager.service
|
systemctl <span class="pl-c1">enable</span> NetworkManager.service
|
||||||
|
@ -441,57 +447,59 @@ noarp
|
||||||
nohook resolv.conf</pre
|
nohook resolv.conf</pre
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<h5>
|
<div class="markdown-heading">
|
||||||
|
<h5 class="heading-element">Bluetooth</h5>
|
||||||
<a
|
<a
|
||||||
id="user-content-bluetooth"
|
id="user-content-bluetooth"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Bluetooth"
|
||||||
tabindex="-1"
|
|
||||||
href="#bluetooth"
|
href="#bluetooth"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Bluetooth
|
></a>
|
||||||
</h5>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacman -Syu bluez
|
<pre>pacman -Syu bluez
|
||||||
systemctl <span class="pl-c1">enable</span> bluetooth.service</pre>
|
systemctl <span class="pl-c1">enable</span> bluetooth.service</pre>
|
||||||
</div>
|
</div>
|
||||||
<h5>
|
<div class="markdown-heading">
|
||||||
|
<h5 class="heading-element">Clock</h5>
|
||||||
<a
|
<a
|
||||||
id="user-content-clock"
|
id="user-content-clock"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Clock"
|
||||||
tabindex="-1"
|
|
||||||
href="#clock"
|
href="#clock"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Clock
|
></a>
|
||||||
</h5>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>timedatectl set-ntp <span class="pl-c1">true</span></pre>
|
<pre>timedatectl set-ntp <span class="pl-c1">true</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Boot loader</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-boot-loader"
|
id="user-content-boot-loader"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Boot loader"
|
||||||
tabindex="-1"
|
|
||||||
href="#boot-loader"
|
href="#boot-loader"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Boot loader
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<h5>
|
<div class="markdown-heading">
|
||||||
|
<h5 class="heading-element">
|
||||||
<a
|
<a
|
||||||
id="user-content-systemd-boot"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#systemd-boot"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a
|
|
||||||
href="https://wiki.archlinux.org/index.php/Systemd-boot"
|
href="https://wiki.archlinux.org/index.php/Systemd-boot"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
>systemd-boot</a
|
>systemd-boot</a
|
||||||
>
|
>
|
||||||
</h5>
|
</h5>
|
||||||
|
<a
|
||||||
|
id="user-content-systemd-boot"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: systemd-boot"
|
||||||
|
href="#systemd-boot"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Install using XBOOTLDR:</p>
|
<p>Install using XBOOTLDR:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>bootctl --esp-path=/efi --boot-path=/boot install
|
<pre>bootctl --esp-path=/efi --boot-path=/boot install
|
||||||
|
@ -538,34 +546,36 @@ initrd /initramfs-linux.img
|
||||||
<span class="pl-c"># nvidia-drm.modeset=1</span>
|
<span class="pl-c"># nvidia-drm.modeset=1</span>
|
||||||
options root="LABEL=ROOT" rw</pre>
|
options root="LABEL=ROOT" rw</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
<a
|
<a
|
||||||
id="user-content-general-recommendations"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#general-recommendations"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a
|
|
||||||
href="https://wiki.archlinux.org/index.php/General_recommendations"
|
href="https://wiki.archlinux.org/index.php/General_recommendations"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
>General recommendations</a
|
>General recommendations</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-general-recommendations"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: General recommendations"
|
||||||
|
href="#general-recommendations"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Always remember to check <strong>dependencies</strong> when install
|
Always remember to check <strong>dependencies</strong> when install
|
||||||
packages.
|
packages.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">System administration</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-system-administration"
|
id="user-content-system-administration"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: System administration"
|
||||||
tabindex="-1"
|
|
||||||
href="#system-administration"
|
href="#system-administration"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>System administration
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://wiki.archlinux.org/index.php/sudo" rel="nofollow">Sudo</a
|
<a href="https://wiki.archlinux.org/index.php/sudo" rel="nofollow">Sudo</a
|
||||||
>:
|
>:
|
||||||
|
@ -604,16 +614,16 @@ homectl update joker --shell=/usr/bin/zsh</pre>
|
||||||
<strong>Note</strong>: Can not run <code>homectl</code> when install Arch
|
<strong>Note</strong>: Can not run <code>homectl</code> when install Arch
|
||||||
Linux. Should run on the first boot.
|
Linux. Should run on the first boot.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Desktop Environment</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-desktop-environment"
|
id="user-content-desktop-environment"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Desktop Environment"
|
||||||
tabindex="-1"
|
|
||||||
href="#desktop-environment"
|
href="#desktop-environment"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Desktop Environment
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Install
|
Install
|
||||||
<a href="https://wiki.archlinux.org/index.php/Xorg" rel="nofollow">Xorg</a
|
<a href="https://wiki.archlinux.org/index.php/Xorg" rel="nofollow">Xorg</a
|
||||||
|
@ -622,18 +632,20 @@ homectl update joker --shell=/usr/bin/zsh</pre>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacman -Syu xorg-server</pre>
|
<pre>pacman -Syu xorg-server</pre>
|
||||||
</div>
|
</div>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
<a
|
<h4 class="heading-element">
|
||||||
id="user-content-gnome"
|
<a href="https://wiki.archlinux.org/index.php/GNOME" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#gnome"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://wiki.archlinux.org/index.php/GNOME" rel="nofollow"
|
|
||||||
>GNOME</a
|
>GNOME</a
|
||||||
>
|
>
|
||||||
</h4>
|
</h4>
|
||||||
|
<a
|
||||||
|
id="user-content-gnome"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: GNOME"
|
||||||
|
href="#gnome"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacman -Syu gnome-shell \
|
<pre>pacman -Syu gnome-shell \
|
||||||
gnome-control-center gnome-system-monitor power-profiles-daemon \
|
gnome-control-center gnome-system-monitor power-profiles-daemon \
|
||||||
|
@ -655,50 +667,56 @@ systemctl <span class="pl-c1">enable</span> gdm.service</pre>
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
<a
|
<a
|
||||||
id="user-content-list-of-applications"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#list-of-applications"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a
|
|
||||||
href="https://wiki.archlinux.org/index.php/List_of_applications"
|
href="https://wiki.archlinux.org/index.php/List_of_applications"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
>List of applications</a
|
>List of applications</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
<h3>
|
|
||||||
<a
|
<a
|
||||||
id="user-content-pacman"
|
id="user-content-list-of-applications"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: List of applications"
|
||||||
tabindex="-1"
|
href="#list-of-applications"
|
||||||
href="#pacman"
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
></a>
|
||||||
><a href="https://wiki.archlinux.org/index.php/pacman" rel="nofollow"
|
</div>
|
||||||
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">
|
||||||
|
<a href="https://wiki.archlinux.org/index.php/pacman" rel="nofollow"
|
||||||
>pacman</a
|
>pacman</a
|
||||||
>
|
>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-pacman"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: pacman"
|
||||||
|
href="#pacman"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Uncomment in <code>/etc/pacman.conf</code>:</p>
|
<p>Uncomment in <code>/etc/pacman.conf</code>:</p>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre><span class="pl-c"># Misc options</span>
|
<pre><span class="pl-c"># Misc options</span>
|
||||||
Color
|
Color
|
||||||
ParallelDownloads</pre>
|
ParallelDownloads</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-pipewire-wip"
|
<a href="https://wiki.archlinux.org/title/PipeWire" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#pipewire-wip"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://wiki.archlinux.org/title/PipeWire" rel="nofollow"
|
|
||||||
>Pipewire (WIP)</a
|
>Pipewire (WIP)</a
|
||||||
>
|
>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-pipewire-wip"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Pipewire (WIP)"
|
||||||
|
href="#pipewire-wip"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>
|
<pre>
|
||||||
pacman -Syu pipewire wireplumber \
|
pacman -Syu pipewire wireplumber \
|
||||||
|
@ -717,35 +735,39 @@ pacman -Syu pipewire wireplumber \
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacman -Syu sof-firmware</pre>
|
<pre>pacman -Syu sof-firmware</pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-flatpak-wip"
|
<a href="https://wiki.archlinux.org/title/Flatpak" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#flatpak-wip"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://wiki.archlinux.org/title/Flatpak" rel="nofollow"
|
|
||||||
>Flatpak (WIP)</a
|
>Flatpak (WIP)</a
|
||||||
>
|
>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-flatpak-wip"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Flatpak (WIP)"
|
||||||
|
href="#flatpak-wip"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>pacman -Syu flatpak</pre>
|
<pre>pacman -Syu flatpak</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
<a
|
<a
|
||||||
id="user-content-improving-performance"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#improving-performance"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a
|
|
||||||
href="https://wiki.archlinux.org/index.php/improving_performance"
|
href="https://wiki.archlinux.org/index.php/improving_performance"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
>Improving performance</a
|
>Improving performance</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-improving-performance"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Improving performance"
|
||||||
|
href="#improving-performance"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -807,16 +829,16 @@ pacman -Syu pipewire wireplumber \
|
||||||
<pre><span class="pl-c"># https://lwn.net/Articles/911219/</span>
|
<pre><span class="pl-c"># https://lwn.net/Articles/911219/</span>
|
||||||
kernel.split_lock_mitigate = 0</pre>
|
kernel.split_lock_mitigate = 0</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Hardware dependent</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-hardware-dependent"
|
id="user-content-hardware-dependent"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Hardware dependent"
|
||||||
tabindex="-1"
|
|
||||||
href="#hardware-dependent"
|
href="#hardware-dependent"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Hardware dependent
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://wiki.archlinux.org/title/Laptop" rel="nofollow"
|
<a href="https://wiki.archlinux.org/title/Laptop" rel="nofollow"
|
||||||
|
@ -834,16 +856,16 @@ kernel.split_lock_mitigate = 0</pre>
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Experiment</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-experiment"
|
id="user-content-experiment"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Experiment"
|
||||||
tabindex="-1"
|
|
||||||
href="#experiment"
|
href="#experiment"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Experiment
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Do it at your own risk!!!</p>
|
<p>Do it at your own risk!!!</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -864,16 +886,16 @@ kernel.split_lock_mitigate = 0</pre>
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">In the end</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-in-the-end"
|
id="user-content-in-the-end"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: In the end"
|
||||||
tabindex="-1"
|
|
||||||
href="#in-the-end"
|
href="#in-the-end"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>In the end
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>This guide is updated regularly I promise.</p>
|
<p>This guide is updated regularly I promise.</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Speed up writing Go test ASAP</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-speed-up-writing-go-test-asap"
|
id="user-content-speed-up-writing-go-test-asap"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Speed up writing Go test ASAP"
|
||||||
tabindex="-1"
|
|
||||||
href="#speed-up-writing-go-test-asap"
|
href="#speed-up-writing-go-test-asap"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Speed up writing Go test ASAP
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Imagine your project currently have 0% unit test code coverage. And your
|
Imagine your project currently have 0% unit test code coverage. And your
|
||||||
boss keep pushing it to 80% or even 90%? What do you do? Give up?
|
boss keep pushing it to 80% or even 90%? What do you do? Give up?
|
||||||
|
@ -57,16 +57,18 @@
|
||||||
just make sure your code is running excatly as you intent it to be. If you
|
just make sure your code is running excatly as you intent it to be. If you
|
||||||
don't think about edge case before, unit test won't help you.
|
don't think about edge case before, unit test won't help you.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
First, rewrite the impossible (to test) out
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-first-rewrite-the-impossible-to-test-out"
|
id="user-content-first-rewrite-the-impossible-to-test-out"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: First, rewrite the impossible (to test) out"
|
||||||
tabindex="-1"
|
|
||||||
href="#first-rewrite-the-impossible-to-test-out"
|
href="#first-rewrite-the-impossible-to-test-out"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>First, rewrite the impossible (to test) out
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
When I learn programming, I encounter very interesting idea, which become
|
When I learn programming, I encounter very interesting idea, which become
|
||||||
mainly my mindset when I dev later. I don't recall it clearly, kinda like:
|
mainly my mindset when I dev later. I don't recall it clearly, kinda like:
|
||||||
|
@ -89,16 +91,16 @@
|
||||||
all global var to fields inside some struct.
|
all global var to fields inside some struct.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Let the fun (writing test) begin</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-let-the-fun-writing-test-begin"
|
id="user-content-let-the-fun-writing-test-begin"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Let the fun (writing test) begin"
|
||||||
tabindex="-1"
|
|
||||||
href="#let-the-fun-writing-test-begin"
|
href="#let-the-fun-writing-test-begin"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Let the fun (writing test) begin
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
If you code Go long enough, you know table driven tests and how is that so
|
If you code Go long enough, you know table driven tests and how is that so
|
||||||
useful. You set up test data, then you test. Somewhere in the future, you
|
useful. You set up test data, then you test. Somewhere in the future, you
|
||||||
|
|
|
@ -28,27 +28,27 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Incident come and go</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-incident-come-and-go"
|
id="user-content-incident-come-and-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Incident come and go"
|
||||||
tabindex="-1"
|
|
||||||
href="#incident-come-and-go"
|
href="#incident-come-and-go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Incident come and go
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>This is collect of all incidents I created in the past :(</p>
|
<p>This is collect of all incidents I created in the past :(</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Service starts with empty port</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-service-starts-with-empty-port"
|
id="user-content-service-starts-with-empty-port"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Service starts with empty port"
|
||||||
tabindex="-1"
|
|
||||||
href="#service-starts-with-empty-port"
|
href="#service-starts-with-empty-port"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Service starts with empty port
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Because all configs is read from file.</p>
|
<p>Because all configs is read from file.</p>
|
||||||
<p>
|
<p>
|
||||||
But the port config is empty -> So when service inits, it use that
|
But the port config is empty -> So when service inits, it use that
|
||||||
|
@ -58,16 +58,16 @@
|
||||||
<strong>Solution</strong>: For some configs, make sure to failed first if
|
<strong>Solution</strong>: For some configs, make sure to failed first if
|
||||||
it's empty.
|
it's empty.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Race condition of series of APIs</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-race-condition-of-series-of-apis"
|
id="user-content-race-condition-of-series-of-apis"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Race condition of series of APIs"
|
||||||
tabindex="-1"
|
|
||||||
href="#race-condition-of-series-of-apis"
|
href="#race-condition-of-series-of-apis"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Race condition of series of APIs
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>For example I have 2 APIs:</p>
|
<p>For example I have 2 APIs:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>API upload: allow user to upload image</li>
|
<li>API upload: allow user to upload image</li>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">EKYC - The battle never ends</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-ekyc---the-battle-never-ends"
|
id="user-content-ekyc---the-battle-never-ends"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: EKYC - The battle never ends"
|
||||||
tabindex="-1"
|
|
||||||
href="#ekyc---the-battle-never-ends"
|
href="#ekyc---the-battle-never-ends"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>EKYC - The battle never ends
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>TODO</p>
|
<p>TODO</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Fonts</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-fonts"
|
id="user-content-fonts"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Fonts"
|
||||||
tabindex="-1"
|
|
||||||
href="#fonts"
|
href="#fonts"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Fonts
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
I always want the best fonts for my terminal, my text editor, my ... But
|
I always want the best fonts for my terminal, my text editor, my ... But
|
||||||
I'm not satisfied easily, so I keep trying new fonts. Prefer free fonts of
|
I'm not satisfied easily, so I keep trying new fonts. Prefer free fonts of
|
||||||
|
@ -64,16 +64,18 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Always choose <strong>OTF</strong> over <strong>TTF</strong> format.</p>
|
<p>Always choose <strong>OTF</strong> over <strong>TTF</strong> format.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/JetBrains/JetBrainsMono">JetBrains Mono</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-jetbrains-mono"
|
id="user-content-jetbrains-mono"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: JetBrains Mono"
|
||||||
tabindex="-1"
|
|
||||||
href="#jetbrains-mono"
|
href="#jetbrains-mono"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/JetBrains/JetBrainsMono">JetBrains Mono</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>JetBrains branding font.</p>
|
<p>JetBrains branding font.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support Vietnamese</li>
|
<li>Support Vietnamese</li>
|
||||||
|
@ -86,16 +88,18 @@
|
||||||
<code>cv16</code>, <code>cv18</code>, <code>cv19</code>,
|
<code>cv16</code>, <code>cv18</code>, <code>cv19</code>,
|
||||||
<code>cv20</code>.
|
<code>cv20</code>.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/be5invis/Iosevka">Iosevka</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-iosevka"
|
id="user-content-iosevka"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Iosevka"
|
||||||
tabindex="-1"
|
|
||||||
href="#iosevka"
|
href="#iosevka"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/be5invis/Iosevka">Iosevka</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>I often choose SS08 variant because I also love PragmataPro too.</p>
|
<p>I often choose SS08 variant because I also love PragmataPro too.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support Vietnamese</li>
|
<li>Support Vietnamese</li>
|
||||||
|
@ -108,16 +112,18 @@
|
||||||
Font is narrow, can display much more on small screen. But too much
|
Font is narrow, can display much more on small screen. But too much
|
||||||
config/variant for ligatures scares me.
|
config/variant for ligatures scares me.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/arrowtype/recursive">Recursive</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-recursive"
|
id="user-content-recursive"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Recursive"
|
||||||
tabindex="-1"
|
|
||||||
href="#recursive"
|
href="#recursive"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/arrowtype/recursive">Recursive</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>I often choose Casual variant.</p>
|
<p>I often choose Casual variant.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support Vietnamese</li>
|
<li>Support Vietnamese</li>
|
||||||
|
@ -135,16 +141,18 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/blobject/agave">agave</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-agave"
|
id="user-content-agave"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: agave"
|
||||||
tabindex="-1"
|
|
||||||
href="#agave"
|
href="#agave"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/blobject/agave">agave</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>No Vietnamese</li>
|
<li>No Vietnamese</li>
|
||||||
<li>Support bold</li>
|
<li>Support bold</li>
|
||||||
|
@ -156,16 +164,18 @@
|
||||||
Font is small, can display much more on small screen. I like its curved
|
Font is small, can display much more on small screen. I like its curved
|
||||||
look.
|
look.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/jenskutilek/sudo-font">Sudo</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-sudo"
|
id="user-content-sudo"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Sudo"
|
||||||
tabindex="-1"
|
|
||||||
href="#sudo"
|
href="#sudo"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/jenskutilek/sudo-font">Sudo</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Small fonts, saving space.</p>
|
<p>Small fonts, saving space.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support Vietnamese</li>
|
<li>Support Vietnamese</li>
|
||||||
|
@ -178,36 +188,39 @@
|
||||||
Unique to me. Strange <code>#</code>, looks same as <code>4</code> (I
|
Unique to me. Strange <code>#</code>, looks same as <code>4</code> (I
|
||||||
don't like it for now).
|
don't like it for now).
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-fantasque-sans-mono"
|
<a href="https://github.com/belluzj/fantasque-sans"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#fantasque-sans-mono"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://github.com/belluzj/fantasque-sans"
|
|
||||||
>Fantasque Sans Mono</a
|
>Fantasque Sans Mono</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-fantasque-sans-mono"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Fantasque Sans Mono"
|
||||||
|
href="#fantasque-sans-mono"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>Comic vibe. Look smoothly and too much curve.</p>
|
<p>Comic vibe. Look smoothly and too much curve.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>No Vietnamese</li>
|
<li>No Vietnamese</li>
|
||||||
<li>Support bold, italic</li>
|
<li>Support bold, italic</li>
|
||||||
<li>Support ligatures</li>
|
<li>Support ligatures</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-apl-385-and-apl386"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#apl-385-and-apl386"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span
|
|
||||||
></a>
|
|
||||||
<a href="https://apl385.com/fonts/index.htm" rel="nofollow">APL-385</a>
|
<a href="https://apl385.com/fonts/index.htm" rel="nofollow">APL-385</a>
|
||||||
and <a href="https://github.com/abrudz/APL386">APL386</a>
|
and <a href="https://github.com/abrudz/APL386">APL386</a>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-apl-385-and-apl386"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: APL-385 and APL386"
|
||||||
|
href="#apl-385-and-apl386"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>No Vietnamese</li>
|
<li>No Vietnamese</li>
|
||||||
<li>No bold, italic</li>
|
<li>No bold, italic</li>
|
||||||
|
@ -215,16 +228,18 @@
|
||||||
<li>Has display font (APL333)</li>
|
<li>Has display font (APL333)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>I love its wide look, also it's feel nostalgic.</p>
|
<p>I love its wide look, also it's feel nostalgic.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/IBM/plex">IBM Plex</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-ibm-plex"
|
id="user-content-ibm-plex"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: IBM Plex"
|
||||||
tabindex="-1"
|
|
||||||
href="#ibm-plex"
|
href="#ibm-plex"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/IBM/plex">IBM Plex</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
IBM branding font, good alternative for Inter, has both monospace and
|
IBM branding font, good alternative for Inter, has both monospace and
|
||||||
display variant.
|
display variant.
|
||||||
|
@ -237,44 +252,50 @@
|
||||||
<li>Has display font</li>
|
<li>Has display font</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Looks fancy. Strange <code>#</code>.</p>
|
<p>Looks fancy. Strange <code>#</code>.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/pcaro90/hermit">Hermit</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-hermit"
|
id="user-content-hermit"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Hermit"
|
||||||
tabindex="-1"
|
|
||||||
href="#hermit"
|
href="#hermit"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/pcaro90/hermit">Hermit</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>No Vietnamese</li>
|
<li>No Vietnamese</li>
|
||||||
<li>Support bold, italic</li>
|
<li>Support bold, italic</li>
|
||||||
<li>No ligatures</li>
|
<li>No ligatures</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Looks unique to me, with some sharp look.</p>
|
<p>Looks unique to me, with some sharp look.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/ryanoasis/nerd-fonts">Nerd Fonts</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-nerd-fonts"
|
id="user-content-nerd-fonts"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Nerd Fonts"
|
||||||
tabindex="-1"
|
|
||||||
href="#nerd-fonts"
|
href="#nerd-fonts"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/ryanoasis/nerd-fonts">Nerd Fonts</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>For fancy terminal, only need <code>NerdFontsSymbolsOnly</code></p>
|
<p>For fancy terminal, only need <code>NerdFontsSymbolsOnly</code></p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-murr-fonts-but-i-dont-use-much-now-some-fonts-i-already-try-in-the-past"
|
Murr fonts, but I don't use much now (some fonts I already try in the
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#murr-fonts-but-i-dont-use-much-now-some-fonts-i-already-try-in-the-past"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Murr fonts, but I don't use much now (some fonts I already try in the
|
|
||||||
past)
|
past)
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-murr-fonts-but-i-dont-use-much-now-some-fonts-i-already-try-in-the-past"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Murr fonts, but I don't use much now (some fonts I already try in the past)"
|
||||||
|
href="#murr-fonts-but-i-dont-use-much-now-some-fonts-i-already-try-in-the-past"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/tonsky/FiraCode">Fira Code</a>: best
|
<a href="https://github.com/tonsky/FiraCode">Fira Code</a>: best
|
||||||
|
@ -332,16 +353,16 @@
|
||||||
shape.
|
shape.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Bitmap/Oldschool</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-bitmapoldschool"
|
id="user-content-bitmapoldschool"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Bitmap/Oldschool"
|
||||||
tabindex="-1"
|
|
||||||
href="#bitmapoldschool"
|
href="#bitmapoldschool"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Bitmap/Oldschool
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://terminus-font.sourceforge.net/" rel="nofollow"
|
<a href="https://terminus-font.sourceforge.net/" rel="nofollow"
|
||||||
|
@ -383,16 +404,16 @@
|
||||||
>: bitmap vibe but support vector.
|
>: bitmap vibe but support vector.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Only display</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-only-display"
|
id="user-content-only-display"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Only display"
|
||||||
tabindex="-1"
|
|
||||||
href="#only-display"
|
href="#only-display"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Only display
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/intel/clear-sans">Clear Sans</a>: used to be
|
<a href="https://github.com/intel/clear-sans">Clear Sans</a>: used to be
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Games 4 fun</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-games-4-fun"
|
id="user-content-games-4-fun"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Games 4 fun"
|
||||||
tabindex="-1"
|
|
||||||
href="#games-4-fun"
|
href="#games-4-fun"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Games 4 fun
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Just a little note about apps, games, settings for next time playing :D
|
Just a little note about apps, games, settings for next time playing :D
|
||||||
Please have fun, of course :D
|
Please have fun, of course :D
|
||||||
|
@ -47,16 +47,16 @@
|
||||||
<li>My work laptop (Macbook Pro M1 (2020)).</li>
|
<li>My work laptop (Macbook Pro M1 (2020)).</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>If below links die, I will try to scrape Internet to get a new link.</p>
|
<p>If below links die, I will try to scrape Internet to get a new link.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">PS2 emulator</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-ps2-emulator"
|
id="user-content-ps2-emulator"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: PS2 emulator"
|
||||||
tabindex="-1"
|
|
||||||
href="#ps2-emulator"
|
href="#ps2-emulator"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>PS2 emulator
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
I use <a href="https://github.com/PCSX2/pcsx2">PCSX2</a>. Currently it
|
I use <a href="https://github.com/PCSX2/pcsx2">PCSX2</a>. Currently it
|
||||||
supports macOS on nightly builds, but it's good enough.
|
supports macOS on nightly builds, but it's good enough.
|
||||||
|
@ -110,18 +110,20 @@
|
||||||
For cover art of games, please use
|
For cover art of games, please use
|
||||||
<a href="https://github.com/xlenore/ps2-covers">xlenore/ps2-covers</a>.
|
<a href="https://github.com/xlenore/ps2-covers">xlenore/ps2-covers</a>.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
<a
|
<h3 class="heading-element">
|
||||||
id="user-content-resident-evil-4"
|
<a href="https://wiki.pcsx2.net/Resident_Evil_4" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#resident-evil-4"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://wiki.pcsx2.net/Resident_Evil_4" rel="nofollow"
|
|
||||||
>Resident Evil 4</a
|
>Resident Evil 4</a
|
||||||
>
|
>
|
||||||
</h3>
|
</h3>
|
||||||
|
<a
|
||||||
|
id="user-content-resident-evil-4"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Resident Evil 4"
|
||||||
|
href="#resident-evil-4"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -203,16 +205,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
style="max-width: 100%"
|
style="max-width: 100%"
|
||||||
/></a>
|
/></a>
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Mega Man X Collection</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-mega-man-x-collection"
|
id="user-content-mega-man-x-collection"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Mega Man X Collection"
|
||||||
tabindex="-1"
|
|
||||||
href="#mega-man-x-collection"
|
href="#mega-man-x-collection"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Mega Man X Collection
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -230,16 +232,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
</li>
|
</li>
|
||||||
<li><a href="https://vimm.net/vault/8736" rel="nofollow">vimm</a></li>
|
<li><a href="https://vimm.net/vault/8736" rel="nofollow">vimm</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Mega Man X8</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-mega-man-x8"
|
id="user-content-mega-man-x8"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Mega Man X8"
|
||||||
tabindex="-1"
|
|
||||||
href="#mega-man-x8"
|
href="#mega-man-x8"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Mega Man X8
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://cdromance.com/ps2-iso/mega-man-x8-usa/" rel="nofollow"
|
<a href="https://cdromance.com/ps2-iso/mega-man-x8-usa/" rel="nofollow"
|
||||||
|
@ -255,16 +257,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
</li>
|
</li>
|
||||||
<li><a href="https://vimm.net/vault/8738" rel="nofollow">vimm</a></li>
|
<li><a href="https://vimm.net/vault/8738" rel="nofollow">vimm</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">God of War</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-god-of-war"
|
id="user-content-god-of-war"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: God of War"
|
||||||
tabindex="-1"
|
|
||||||
href="#god-of-war"
|
href="#god-of-war"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>God of War
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://cdromance.com/ps2-iso/god-of-war-usa/" rel="nofollow"
|
<a href="https://cdromance.com/ps2-iso/god-of-war-usa/" rel="nofollow"
|
||||||
|
@ -305,16 +307,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
<a href="https://ko-fi.com/pandavenom" rel="nofollow">Panda Venom</a> for
|
<a href="https://ko-fi.com/pandavenom" rel="nofollow">Panda Venom</a> for
|
||||||
his work.
|
his work.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">God of War II</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-god-of-war-ii"
|
id="user-content-god-of-war-ii"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: God of War II"
|
||||||
tabindex="-1"
|
|
||||||
href="#god-of-war-ii"
|
href="#god-of-war-ii"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>God of War II
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -357,16 +359,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
<a href="https://ko-fi.com/pandavenom" rel="nofollow">Panda Venom</a> for
|
<a href="https://ko-fi.com/pandavenom" rel="nofollow">Panda Venom</a> for
|
||||||
his work.
|
his work.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Shadow of the Colossus</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-shadow-of-the-colossus"
|
id="user-content-shadow-of-the-colossus"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Shadow of the Colossus"
|
||||||
tabindex="-1"
|
|
||||||
href="#shadow-of-the-colossus"
|
href="#shadow-of-the-colossus"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Shadow of the Colossus
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -384,16 +386,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
</li>
|
</li>
|
||||||
<li><a href="https://vimm.net/vault/9219" rel="nofollow">vimm</a></li>
|
<li><a href="https://vimm.net/vault/9219" rel="nofollow">vimm</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">PS3 emulator</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-ps3-emulator"
|
id="user-content-ps3-emulator"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: PS3 emulator"
|
||||||
tabindex="-1"
|
|
||||||
href="#ps3-emulator"
|
href="#ps3-emulator"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>PS3 emulator
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
I use <a href="https://github.com/RPCS3/rpcs3">RPCS3</a>. Currently it
|
I use <a href="https://github.com/RPCS3/rpcs3">RPCS3</a>. Currently it
|
||||||
supports macOS on nightly builds.
|
supports macOS on nightly builds.
|
||||||
|
@ -417,16 +419,16 @@ patch=1,EE,2012009C,extended,00000000</pre
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Windows games</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-windows-games"
|
id="user-content-windows-games"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Windows games"
|
||||||
tabindex="-1"
|
|
||||||
href="#windows-games"
|
href="#windows-games"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Windows games
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,53 +28,53 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Keeb</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-keeb"
|
id="user-content-keeb"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Keeb"
|
||||||
tabindex="-1"
|
|
||||||
href="#keeb"
|
href="#keeb"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Keeb
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>My collection of mechanical keyboards.</p>
|
<p>My collection of mechanical keyboards.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Keyboard</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-keyboard"
|
id="user-content-keyboard"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Keyboard"
|
||||||
tabindex="-1"
|
|
||||||
href="#keyboard"
|
href="#keyboard"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Keyboard
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
QMK custom keymaps is
|
QMK custom keymaps is
|
||||||
<a href="https://github.com/haunt98/qmk_keymaps">here</a>
|
<a href="https://github.com/haunt98/qmk_keymaps">here</a>
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">iKBC CD87 Cherry MX Blue</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-ikbc-cd87-cherry-mx-blue"
|
id="user-content-ikbc-cd87-cherry-mx-blue"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: iKBC CD87 Cherry MX Blue"
|
||||||
tabindex="-1"
|
|
||||||
href="#ikbc-cd87-cherry-mx-blue"
|
href="#ikbc-cd87-cherry-mx-blue"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>iKBC CD87 Cherry MX Blue
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>My first keeb.</p>
|
<p>My first keeb.</p>
|
||||||
<p>Damn it's so loud :D</p>
|
<p>Damn it's so loud :D</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">KBDfans X Lazurite D60Lite</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-kbdfans-x-lazurite-d60lite"
|
id="user-content-kbdfans-x-lazurite-d60lite"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: KBDfans X Lazurite D60Lite"
|
||||||
tabindex="-1"
|
|
||||||
href="#kbdfans-x-lazurite-d60lite"
|
href="#kbdfans-x-lazurite-d60lite"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>KBDfans X Lazurite D60Lite
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>I bought it from my friend.</p>
|
<p>I bought it from my friend.</p>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
@ -289,16 +289,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Sofle V2</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-sofle-v2"
|
id="user-content-sofle-v2"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Sofle V2"
|
||||||
tabindex="-1"
|
|
||||||
href="#sofle-v2"
|
href="#sofle-v2"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Sofle V2
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
I bought it from
|
I bought it from
|
||||||
<a
|
<a
|
||||||
|
@ -314,16 +314,16 @@
|
||||||
<li>Sandwhich style is meh when typing, so I buy Aluminium case.</li>
|
<li>Sandwhich style is meh when typing, so I buy Aluminium case.</li>
|
||||||
<li>The left sandwich case is so tight to put switch in.</li>
|
<li>The left sandwich case is so tight to put switch in.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Guide</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-guide"
|
id="user-content-guide"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Guide"
|
||||||
tabindex="-1"
|
|
||||||
href="#guide"
|
href="#guide"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Guide
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://val.packett.cool/blog/ergonice/" rel="nofollow"
|
<a href="https://val.packett.cool/blog/ergonice/" rel="nofollow"
|
||||||
|
@ -338,26 +338,26 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Switch</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-switch"
|
id="user-content-switch"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Switch"
|
||||||
tabindex="-1"
|
|
||||||
href="#switch"
|
href="#switch"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Switch
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">KTT Strawberry</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-ktt-strawberry"
|
id="user-content-ktt-strawberry"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: KTT Strawberry"
|
||||||
tabindex="-1"
|
|
||||||
href="#ktt-strawberry"
|
href="#ktt-strawberry"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>KTT Strawberry
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Buy it from ShopeeVN. I choose this switch because I prefer linear (please
|
Buy it from ShopeeVN. I choose this switch because I prefer linear (please
|
||||||
be silent).
|
be silent).
|
||||||
|
@ -408,16 +408,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">SKYLOONG Glacier Silent Red Switch</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-skyloong-glacier-silent-red-switch"
|
id="user-content-skyloong-glacier-silent-red-switch"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: SKYLOONG Glacier Silent Red Switch"
|
||||||
tabindex="-1"
|
|
||||||
href="#skyloong-glacier-silent-red-switch"
|
href="#skyloong-glacier-silent-red-switch"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>SKYLOONG Glacier Silent Red Switch
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
I was given this switch by my friend. Currently using for alpha keys. Love
|
I was given this switch by my friend. Currently using for alpha keys. Love
|
||||||
the silent.
|
the silent.
|
||||||
|
@ -452,16 +452,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">JWICK Yellow Linear Switch</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-jwick-yellow-linear-switch"
|
id="user-content-jwick-yellow-linear-switch"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: JWICK Yellow Linear Switch"
|
||||||
tabindex="-1"
|
|
||||||
href="#jwick-yellow-linear-switch"
|
href="#jwick-yellow-linear-switch"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>JWICK Yellow Linear Switch
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -492,16 +492,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">C3 Equalz Tangerine V2</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-c3-equalz-tangerine-v2"
|
id="user-content-c3-equalz-tangerine-v2"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: C3 Equalz Tangerine V2"
|
||||||
tabindex="-1"
|
|
||||||
href="#c3-equalz-tangerine-v2"
|
href="#c3-equalz-tangerine-v2"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>C3 Equalz Tangerine V2
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -555,16 +555,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">CHERRY MX2A Black</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-cherry-mx2a-black"
|
id="user-content-cherry-mx2a-black"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: CHERRY MX2A Black"
|
||||||
tabindex="-1"
|
|
||||||
href="#cherry-mx2a-black"
|
href="#cherry-mx2a-black"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>CHERRY MX2A Black
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -610,16 +610,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Keycap</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-keycap"
|
id="user-content-keycap"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Keycap"
|
||||||
tabindex="-1"
|
|
||||||
href="#keycap"
|
href="#keycap"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Keycap
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Currently, I use Akko 9009 Cherry Profile and EnjoyPBT 9009 Cherry
|
Currently, I use Akko 9009 Cherry Profile and EnjoyPBT 9009 Cherry
|
||||||
Profile. The space of EnjoyPBT 9009 is not straight so I use Akko 9009
|
Profile. The space of EnjoyPBT 9009 is not straight so I use Akko 9009
|
||||||
|
@ -633,16 +633,16 @@
|
||||||
</li>
|
</li>
|
||||||
<li>Check is keycap is tight on switch or not.</li>
|
<li>Check is keycap is tight on switch or not.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">EnjoyPBT 9009</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-enjoypbt-9009"
|
id="user-content-enjoypbt-9009"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: EnjoyPBT 9009"
|
||||||
tabindex="-1"
|
|
||||||
href="#enjoypbt-9009"
|
href="#enjoypbt-9009"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>EnjoyPBT 9009
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>I buy vim kit first then base later.</p>
|
<p>I buy vim kit first then base later.</p>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
@ -683,16 +683,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">PBTfans BOW</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-pbtfans-bow"
|
id="user-content-pbtfans-bow"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: PBTfans BOW"
|
||||||
tabindex="-1"
|
|
||||||
href="#pbtfans-bow"
|
href="#pbtfans-bow"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>PBTfans BOW
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>I only buy 40s kit.</p>
|
<p>I only buy 40s kit.</p>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
@ -715,16 +715,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">JTK iKey</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-jtk-ikey"
|
id="user-content-jtk-ikey"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: JTK iKey"
|
||||||
tabindex="-1"
|
|
||||||
href="#jtk-ikey"
|
href="#jtk-ikey"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>JTK iKey
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>I bought Blue version with Base, Novel, Space kit from bidding.</p>
|
<p>I bought Blue version with Base, Novel, Space kit from bidding.</p>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
@ -758,16 +758,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">GMK Mecha-01</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-gmk-mecha-01"
|
id="user-content-gmk-mecha-01"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: GMK Mecha-01"
|
||||||
tabindex="-1"
|
|
||||||
href="#gmk-mecha-01"
|
href="#gmk-mecha-01"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>GMK Mecha-01
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>I only bought Base kit.</p>
|
<p>I only bought Base kit.</p>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
@ -790,16 +790,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Color I love</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-color-i-love"
|
id="user-content-color-i-love"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Color I love"
|
||||||
tabindex="-1"
|
|
||||||
href="#color-i-love"
|
href="#color-i-love"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Color I love
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -877,16 +877,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Tools</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-tools"
|
id="user-content-tools"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Tools"
|
||||||
tabindex="-1"
|
|
||||||
href="#tools"
|
href="#tools"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Tools
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/bloznelis/kbt">bloznelis/kbt</a></li>
|
<li><a href="https://github.com/bloznelis/kbt">bloznelis/kbt</a></li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -901,16 +901,16 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Buy history</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-buy-history"
|
id="user-content-buy-history"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Buy history"
|
||||||
tabindex="-1"
|
|
||||||
href="#buy-history"
|
href="#buy-history"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Buy history
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -1036,16 +1036,16 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://matrixzj.github.io/" rel="nofollow"
|
<a href="https://matrixzj.github.io/" rel="nofollow"
|
||||||
|
|
|
@ -28,26 +28,26 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Naming things</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-naming-things"
|
id="user-content-naming-things"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Naming things"
|
||||||
tabindex="-1"
|
|
||||||
href="#naming-things"
|
href="#naming-things"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Naming things
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Filename in storage (S3, ...)</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-filename-in-storage-s3-"
|
id="user-content-filename-in-storage-s3-"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Filename in storage (S3, ...)"
|
||||||
tabindex="-1"
|
|
||||||
href="#filename-in-storage-s3-"
|
href="#filename-in-storage-s3-"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Filename in storage (S3, ...)
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Always have year, month, day in filename to easily sort it out.</p>
|
<p>Always have year, month, day in filename to easily sort it out.</p>
|
||||||
<p>
|
<p>
|
||||||
If file is uploaded by user, add <code>user_id</code> in filename, or some
|
If file is uploaded by user, add <code>user_id</code> in filename, or some
|
||||||
|
@ -67,16 +67,16 @@
|
||||||
backup (as they say, idk if true or not, but less folder mean less
|
backup (as they say, idk if true or not, but less folder mean less
|
||||||
complicated to me).
|
complicated to me).
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Time variable</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-time-variable"
|
id="user-content-time-variable"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Time variable"
|
||||||
tabindex="-1"
|
|
||||||
href="#time-variable"
|
href="#time-variable"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Time variable
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Add time postfix to make sense.</p>
|
<p>Add time postfix to make sense.</p>
|
||||||
<p>Instead of <code>create_at</code>, use <code>create_at_ms</code>.</p>
|
<p>Instead of <code>create_at</code>, use <code>create_at_ms</code>.</p>
|
||||||
|
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">My neovim workflow</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-my-neovim-workflow"
|
id="user-content-my-neovim-workflow"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: My neovim workflow"
|
||||||
tabindex="-1"
|
|
||||||
href="#my-neovim-workflow"
|
href="#my-neovim-workflow"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>My neovim workflow
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -53,16 +53,16 @@
|
||||||
All configs are in
|
All configs are in
|
||||||
<a href="https://github.com/haunt98/dotfiles">my dotfiles</a>.
|
<a href="https://github.com/haunt98/dotfiles">my dotfiles</a>.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Trick or treat</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-trick-or-treat"
|
id="user-content-trick-or-treat"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Trick or treat"
|
||||||
tabindex="-1"
|
|
||||||
href="#trick-or-treat"
|
href="#trick-or-treat"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Trick or treat
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Search current word: <code>*</code></p>
|
<p>Search current word: <code>*</code></p>
|
||||||
<p>Search multiple words:</p>
|
<p>Search multiple words:</p>
|
||||||
<div class="highlight highlight-source-viml">
|
<div class="highlight highlight-source-viml">
|
||||||
|
@ -98,16 +98,16 @@
|
||||||
<div class="highlight highlight-source-viml">
|
<div class="highlight highlight-source-viml">
|
||||||
<pre>:<span class="pl-k">!</span>column <span class="pl-k">-</span><span class="pl-c1">t</span></pre>
|
<pre>:<span class="pl-k">!</span>column <span class="pl-k">-</span><span class="pl-c1">t</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Jumpo</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-jumpo"
|
id="user-content-jumpo"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Jumpo"
|
||||||
tabindex="-1"
|
|
||||||
href="#jumpo"
|
href="#jumpo"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Jumpo
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Basic:</p>
|
<p>Basic:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>gg</code>: first line</li>
|
<li><code>gg</code>: first line</li>
|
||||||
|
@ -146,30 +146,30 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Fold</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-fold"
|
id="user-content-fold"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Fold"
|
||||||
tabindex="-1"
|
|
||||||
href="#fold"
|
href="#fold"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Fold
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>zR</code>: open all folds.</li>
|
<li><code>zR</code>: open all folds.</li>
|
||||||
<li><code>za</code>, <code>zA</code>: toggle fold</li>
|
<li><code>za</code>, <code>zA</code>: toggle fold</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Keymap</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-keymap"
|
id="user-content-keymap"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Keymap"
|
||||||
tabindex="-1"
|
|
||||||
href="#keymap"
|
href="#keymap"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Keymap
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Use both <code>\</code> and <code>;</code> as leader key:</p>
|
<p>Use both <code>\</code> and <code>;</code> as leader key:</p>
|
||||||
<div class="highlight highlight-source-lua">
|
<div class="highlight highlight-source-lua">
|
||||||
<pre>vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>;<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><Leader><span class="pl-pds">"</span></span>, { remap <span class="pl-k">=</span> <span class="pl-c1">true</span> })
|
<pre>vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span class="pl-s"><span class="pl-pds">"</span>n<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>;<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span><Leader><span class="pl-pds">"</span></span>, { remap <span class="pl-k">=</span> <span class="pl-c1">true</span> })
|
||||||
|
@ -324,16 +324,16 @@ vim.<span class="pl-smi">keymap</span>.<span class="pl-c1">set</span>(<span clas
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">References / Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-references--thanks"
|
id="user-content-references--thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: References / Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#references--thanks"
|
href="#references--thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>References / Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
vim docs:
|
vim docs:
|
||||||
|
|
|
@ -28,26 +28,26 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Things I like</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-things-i-like"
|
id="user-content-things-i-like"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Things I like"
|
||||||
tabindex="-1"
|
|
||||||
href="#things-i-like"
|
href="#things-i-like"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Things I like
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Discord (old) naming</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-discord-old-naming"
|
id="user-content-discord-old-naming"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Discord (old) naming"
|
||||||
tabindex="-1"
|
|
||||||
href="#discord-old-naming"
|
href="#discord-old-naming"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Discord (old) naming
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
The way Discord naming user like<code>Joker#1234</code> is so interesting.
|
The way Discord naming user like<code>Joker#1234</code> is so interesting.
|
||||||
If user A register first with name <code>ABCXYZ</code>, and later user B
|
If user A register first with name <code>ABCXYZ</code>, and later user B
|
||||||
|
@ -58,16 +58,16 @@
|
||||||
Why it's interesting? Each time I join a new platform, all names I want
|
Why it's interesting? Each time I join a new platform, all names I want
|
||||||
are taken :D
|
are taken :D
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Interesting website</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-interesting-website"
|
id="user-content-interesting-website"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Interesting website"
|
||||||
tabindex="-1"
|
|
||||||
href="#interesting-website"
|
href="#interesting-website"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Interesting website
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://deskto.ps/" rel="nofollow">deskto.ps</a></li>
|
<li><a href="https://deskto.ps/" rel="nofollow">deskto.ps</a></li>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Swagger or OpenAPI</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-swagger-or-openapi"
|
id="user-content-swagger-or-openapi"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Swagger or OpenAPI"
|
||||||
tabindex="-1"
|
|
||||||
href="#swagger-or-openapi"
|
href="#swagger-or-openapi"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Swagger or OpenAPI
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>My company currently use Swagger 2 to document API.</p>
|
<p>My company currently use Swagger 2 to document API.</p>
|
||||||
<p>
|
<p>
|
||||||
I want to work with OpenAPI 3 but too lazy to convert (for now of course).
|
I want to work with OpenAPI 3 but too lazy to convert (for now of course).
|
||||||
|
@ -65,16 +65,16 @@ bunx prettier@latest --write ./docs/swagger.yaml ./docs/swagger.json
|
||||||
<span class="pl-c"><span class="pl-c">#</span> Render locally</span>
|
<span class="pl-c"><span class="pl-c">#</span> Render locally</span>
|
||||||
bunx @redocly/cli preview-docs ./docs/swagger.json</pre>
|
bunx @redocly/cli preview-docs ./docs/swagger.json</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/mikefarah/yq">mikefarah/yq</a></li>
|
<li><a href="https://github.com/mikefarah/yq">mikefarah/yq</a></li>
|
||||||
<li><a href="https://github.com/oven-sh/bun">oven-sh/bun</a></li>
|
<li><a href="https://github.com/oven-sh/bun">oven-sh/bun</a></li>
|
||||||
|
|
|
@ -28,46 +28,50 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">My terminal workflow</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-my-terminal-workflow"
|
id="user-content-my-terminal-workflow"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: My terminal workflow"
|
||||||
tabindex="-1"
|
|
||||||
href="#my-terminal-workflow"
|
href="#my-terminal-workflow"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>My terminal workflow
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
All configs are in
|
All configs are in
|
||||||
<a href="https://github.com/haunt98/dotfiles">my dotfiles</a>.
|
<a href="https://github.com/haunt98/dotfiles">my dotfiles</a>.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
Use <a href="https://github.com/junegunn/fzf">junegunn/fzf</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-use-junegunnfzf"
|
id="user-content-use-junegunnfzf"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Use junegunn/fzf"
|
||||||
tabindex="-1"
|
|
||||||
href="#use-junegunnfzf"
|
href="#use-junegunnfzf"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Use <a href="https://github.com/junegunn/fzf">junegunn/fzf</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>CTRL-T</code> to fuzzy find files.</li>
|
<li><code>CTRL-T</code> to fuzzy find files.</li>
|
||||||
<li><code>ALT-C</code> to fuzzy find directories.</li>
|
<li><code>ALT-C</code> to fuzzy find directories.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-use-zellij-orgzellij-as-guide-keybinding"
|
Use
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#use-zellij-orgzellij-as-guide-keybinding"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
>Use
|
|
||||||
<a href="https://github.com/zellij-org/zellij">zellij-org/zellij</a> as
|
<a href="https://github.com/zellij-org/zellij">zellij-org/zellij</a> as
|
||||||
guide keybinding
|
guide keybinding
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-use-zellij-orgzellij-as-guide-keybinding"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Use zellij-org/zellij as guide keybinding"
|
||||||
|
href="#use-zellij-orgzellij-as-guide-keybinding"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
|
@ -28,28 +28,28 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Another day another incident #02</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-another-day-another-incident-02"
|
id="user-content-another-day-another-incident-02"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Another day another incident #02"
|
||||||
tabindex="-1"
|
|
||||||
href="#another-day-another-incident-02"
|
href="#another-day-another-incident-02"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Another day another incident #02
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>Today's incident is all about Go context.</p>
|
<p>Today's incident is all about Go context.</p>
|
||||||
<p>TLDR: context got canceled, but it shouldn't.</p>
|
<p>TLDR: context got canceled, but it shouldn't.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">The problem</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-the-problem"
|
id="user-content-the-problem"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: The problem"
|
||||||
tabindex="-1"
|
|
||||||
href="#the-problem"
|
href="#the-problem"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>The problem
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Imagine a chain of APIs:</p>
|
<p>Imagine a chain of APIs:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Calling API A</li>
|
<li>Calling API A</li>
|
||||||
|
@ -123,16 +123,16 @@ doB context deadline exceeded</pre
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<p>As you see both <code>doA</code> and <code>doB</code> are canceled.</p>
|
<p>As you see both <code>doA</code> and <code>doB</code> are canceled.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">The (temporary) solution</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-the-temporary-solution"
|
id="user-content-the-temporary-solution"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: The (temporary) solution"
|
||||||
tabindex="-1"
|
|
||||||
href="#the-temporary-solution"
|
href="#the-temporary-solution"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>The (temporary) solution
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Quick Google search leads me to
|
Quick Google search leads me to
|
||||||
<a href="https://github.com/golang/go/issues/40221"
|
<a href="https://github.com/golang/go/issues/40221"
|
||||||
|
@ -246,16 +246,16 @@ doB</pre
|
||||||
As you see only <code>doA</code> is canceled, <code>doB</code> is done
|
As you see only <code>doA</code> is canceled, <code>doB</code> is done
|
||||||
perfectly. And that what we want in this case.
|
perfectly. And that what we want in this case.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Khoan cắt bê tông 101</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-khoan-cắt-bê-tông-101"
|
id="user-content-khoan-cắt-bê-tông-101"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Khoan cắt bê tông 101"
|
||||||
tabindex="-1"
|
|
||||||
href="#khoan-cắt-bê-tông-101"
|
href="#khoan-cắt-bê-tông-101"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Khoan cắt bê tông 101
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>The title is a joke.</p>
|
<p>The title is a joke.</p>
|
||||||
<p>
|
<p>
|
||||||
But after digging a few holes on the wall, I think I should leave a few
|
But after digging a few holes on the wall, I think I should leave a few
|
||||||
|
|
|
@ -28,37 +28,37 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Userful tools</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-userful-tools"
|
id="user-content-userful-tools"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Userful tools"
|
||||||
tabindex="-1"
|
|
||||||
href="#userful-tools"
|
href="#userful-tools"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Userful tools
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>This just a raw list.</p>
|
<p>This just a raw list.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Tools</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-tools"
|
id="user-content-tools"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Tools"
|
||||||
tabindex="-1"
|
|
||||||
href="#tools"
|
href="#tools"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Tools
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Terminal</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-terminal"
|
id="user-content-terminal"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Terminal"
|
||||||
tabindex="-1"
|
|
||||||
href="#terminal"
|
href="#terminal"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Terminal
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<p>
|
<p>
|
||||||
|
@ -406,16 +406,16 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Windows</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-windows"
|
id="user-content-windows"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Windows"
|
||||||
tabindex="-1"
|
|
||||||
href="#windows"
|
href="#windows"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Windows
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/abbodi1406/KMS_VL_ALL_AIO"
|
<a href="https://github.com/abbodi1406/KMS_VL_ALL_AIO"
|
||||||
|
@ -433,16 +433,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">UI</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-ui"
|
id="user-content-ui"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: UI"
|
||||||
tabindex="-1"
|
|
||||||
href="#ui"
|
href="#ui"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>UI
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/kovidgoyal/kitty"
|
<a href="https://github.com/kovidgoyal/kitty"
|
||||||
|
@ -491,16 +491,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">macOS</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-macos"
|
id="user-content-macos"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: macOS"
|
||||||
tabindex="-1"
|
|
||||||
href="#macos"
|
href="#macos"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>macOS
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://theunarchiver.com/" rel="nofollow"
|
<a href="https://theunarchiver.com/" rel="nofollow"
|
||||||
|
@ -599,26 +599,26 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Developement</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-developement"
|
id="user-content-developement"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Developement"
|
||||||
tabindex="-1"
|
|
||||||
href="#developement"
|
href="#developement"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Developement
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Terminal</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-terminal-1"
|
id="user-content-terminal-1"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Terminal"
|
||||||
tabindex="-1"
|
|
||||||
href="#terminal-1"
|
href="#terminal-1"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Terminal
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/Schniz/fnm"
|
<a href="https://github.com/Schniz/fnm"
|
||||||
|
@ -682,6 +682,11 @@
|
||||||
>https://github.com/golang/tools/tree/master/gopls</a
|
>https://github.com/golang/tools/tree/master/gopls</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="https://github.com/Microsoft/pyright"
|
||||||
|
>https://github.com/Microsoft/pyright</a
|
||||||
|
>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Misc</p>
|
<p>Misc</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -785,16 +790,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">Go</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-go"
|
id="user-content-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Go"
|
||||||
tabindex="-1"
|
|
||||||
href="#go"
|
href="#go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Go
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -861,16 +866,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">UI</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-ui-1"
|
id="user-content-ui-1"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: UI"
|
||||||
tabindex="-1"
|
|
||||||
href="#ui-1"
|
href="#ui-1"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>UI
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://httpie.io/desktop" rel="nofollow"
|
<a href="https://httpie.io/desktop" rel="nofollow"
|
||||||
|
@ -928,16 +933,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4>
|
<div class="markdown-heading">
|
||||||
|
<h4 class="heading-element">macOS</h4>
|
||||||
<a
|
<a
|
||||||
id="user-content-macos-1"
|
id="user-content-macos-1"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: macOS"
|
||||||
tabindex="-1"
|
|
||||||
href="#macos-1"
|
href="#macos-1"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>macOS
|
></a>
|
||||||
</h4>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/orbstack/orbstack"
|
<a href="https://github.com/orbstack/orbstack"
|
||||||
|
@ -956,16 +961,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Notes</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-notes"
|
id="user-content-notes"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Notes"
|
||||||
tabindex="-1"
|
|
||||||
href="#notes"
|
href="#notes"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Notes
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Prefer <code>nix</code>/<code>go</code>/<code>cargo</code>/<code
|
Prefer <code>nix</code>/<code>go</code>/<code>cargo</code>/<code
|
||||||
>pipx</code
|
>pipx</code
|
||||||
|
@ -990,27 +995,27 @@
|
||||||
<li>Docker Desktop</li>
|
<li>Docker Desktop</li>
|
||||||
<li>Any JetBrains IDE beside DataGrip</li>
|
<li>Any JetBrains IDE beside DataGrip</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Misc</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-misc"
|
id="user-content-misc"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Misc"
|
||||||
tabindex="-1"
|
|
||||||
href="#misc"
|
href="#misc"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Misc
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Don't enable plugin <code>git</code> in ohmyzsh.</p>
|
<p>Don't enable plugin <code>git</code> in ohmyzsh.</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">macOS</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-macos-2"
|
id="user-content-macos-2"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: macOS"
|
||||||
tabindex="-1"
|
|
||||||
href="#macos-2"
|
href="#macos-2"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>macOS
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>Use Touch ID in Terminal:</p>
|
<p>Use Touch ID in Terminal:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
|
<pre>sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
|
||||||
|
@ -1071,16 +1076,16 @@ defaults -currentHost write -globalDomain NSStatusItemSpacing -int 6</pre
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Firefox</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-firefox"
|
id="user-content-firefox"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Firefox"
|
||||||
tabindex="-1"
|
|
||||||
href="#firefox"
|
href="#firefox"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Firefox
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p><code>about:config</code>:</p>
|
<p><code>about:config</code>:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -1117,16 +1122,16 @@ defaults -currentHost write -globalDomain NSStatusItemSpacing -int 6</pre
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,27 +28,27 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Throw away pastebin</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-throw-away-pastebin"
|
id="user-content-throw-away-pastebin"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Throw away pastebin"
|
||||||
tabindex="-1"
|
|
||||||
href="#throw-away-pastebin"
|
href="#throw-away-pastebin"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Throw away pastebin
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>Just a place to throw away some text.</p>
|
<p>Just a place to throw away some text.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element"><code>.gitignore</code></h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-gitignore"
|
id="user-content-gitignore"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: .gitignore"
|
||||||
tabindex="-1"
|
|
||||||
href="#gitignore"
|
href="#gitignore"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><code>.gitignore</code>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre><span class="pl-c"># macOS</span>
|
<pre><span class="pl-c"># macOS</span>
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
@ -69,16 +69,16 @@ vendor
|
||||||
<span class="pl-c"># GoReleaser</span>
|
<span class="pl-c"># GoReleaser</span>
|
||||||
dist</pre>
|
dist</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">GitHub Actions</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-github-actions"
|
id="user-content-github-actions"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: GitHub Actions"
|
||||||
tabindex="-1"
|
|
||||||
href="#github-actions"
|
href="#github-actions"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>GitHub Actions
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p><code>dependabot.yml</code>:</p>
|
<p><code>dependabot.yml</code>:</p>
|
||||||
<div class="highlight highlight-source-yaml">
|
<div class="highlight highlight-source-yaml">
|
||||||
<pre><span class="pl-ent">version</span>: <span class="pl-c1">2</span>
|
<pre><span class="pl-ent">version</span>: <span class="pl-c1">2</span>
|
||||||
|
@ -152,16 +152,16 @@ dist</pre>
|
||||||
<span class="pl-ent">with</span>:
|
<span class="pl-ent">with</span>:
|
||||||
<span class="pl-ent">version</span>: <span class="pl-s">latest</span></pre>
|
<span class="pl-ent">version</span>: <span class="pl-s">latest</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Go</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-go"
|
id="user-content-go"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Go"
|
||||||
tabindex="-1"
|
|
||||||
href="#go"
|
href="#go"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Go
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p><code>.golangci.yml</code>:</p>
|
<p><code>.golangci.yml</code>:</p>
|
||||||
<div class="highlight highlight-source-yaml">
|
<div class="highlight highlight-source-yaml">
|
||||||
<pre><span class="pl-ent">run</span>:
|
<pre><span class="pl-ent">run</span>:
|
||||||
|
@ -282,32 +282,32 @@ dist</pre>
|
||||||
<span class="pl-ent">skip</span>: <span class="pl-c1">false</span>
|
<span class="pl-ent">skip</span>: <span class="pl-c1">false</span>
|
||||||
<span class="pl-ent">use</span>: <span class="pl-s">github</span></pre>
|
<span class="pl-ent">use</span>: <span class="pl-s">github</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Git clean up</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-git-clean-up"
|
id="user-content-git-clean-up"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Git clean up"
|
||||||
tabindex="-1"
|
|
||||||
href="#git-clean-up"
|
href="#git-clean-up"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Git clean up
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre><span class="pl-c"><span class="pl-c">#</span> Delete untracked</span>
|
<pre><span class="pl-c"><span class="pl-c">#</span> Delete untracked</span>
|
||||||
git clean -fdx
|
git clean -fdx
|
||||||
|
|
||||||
git gc</pre>
|
git gc</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Delete <code>.DS_Store</code></h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-delete-ds_store"
|
id="user-content-delete-ds_store"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Delete .DS_Store"
|
||||||
tabindex="-1"
|
|
||||||
href="#delete-ds_store"
|
href="#delete-ds_store"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Delete <code>.DS_Store</code>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
With
|
With
|
||||||
<a href="https://stackoverflow.com/q/30483670" rel="nofollow">find</a>:
|
<a href="https://stackoverflow.com/q/30483670" rel="nofollow">find</a>:
|
||||||
|
@ -319,46 +319,52 @@ git gc</pre>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>fd -H <span class="pl-s"><span class="pl-pds">'</span>^\.DS_Store$<span class="pl-pds">'</span></span> -tf -X rm</pre>
|
<pre>fd -H <span class="pl-s"><span class="pl-pds">'</span>^\.DS_Store$<span class="pl-pds">'</span></span> -tf -X rm</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/chmln/sd">sd</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-sd"
|
id="user-content-sd"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: sd"
|
||||||
tabindex="-1"
|
|
||||||
href="#sd"
|
href="#sd"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/chmln/sd">sd</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Remove proto options:</p>
|
<p>Remove proto options:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>sd -F <span class="pl-s"><span class="pl-pds">'</span>import "validate/validate.proto";<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto
|
<pre>sd -F <span class="pl-s"><span class="pl-pds">'</span>import "validate/validate.proto";<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto
|
||||||
sd -F <span class="pl-s"><span class="pl-pds">'</span>import "marshal-zap.proto";<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto
|
sd -F <span class="pl-s"><span class="pl-pds">'</span>import "marshal-zap.proto";<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span><span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto
|
||||||
sd -f s <span class="pl-s"><span class="pl-pds">'</span>\s\[.*?];<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>;<span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto</pre>
|
sd -f s <span class="pl-s"><span class="pl-pds">'</span>\s\[.*?];<span class="pl-pds">'</span></span> <span class="pl-s"><span class="pl-pds">'</span>;<span class="pl-pds">'</span></span> api/raw/<span class="pl-k">*</span>.proto</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/adrianlopezroche/fdupes">fdupes</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-fdupes"
|
id="user-content-fdupes"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: fdupes"
|
||||||
tabindex="-1"
|
|
||||||
href="#fdupes"
|
href="#fdupes"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/adrianlopezroche/fdupes">fdupes</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Remove duplicated files:</p>
|
<p>Remove duplicated files:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>fdupes -rdN <span class="pl-c1">.</span></pre>
|
<pre>fdupes -rdN <span class="pl-c1">.</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/WayneD/rsync">rsync</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-rsync"
|
id="user-content-rsync"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: rsync"
|
||||||
tabindex="-1"
|
|
||||||
href="#rsync"
|
href="#rsync"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/WayneD/rsync">rsync</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre><span class="pl-c"><span class="pl-c">#</span> Result is dst/src</span>
|
<pre><span class="pl-c"><span class="pl-c">#</span> Result is dst/src</span>
|
||||||
rsync -avzP src dst
|
rsync -avzP src dst
|
||||||
|
@ -387,16 +393,18 @@ rsync -avzP src/ dst</pre>
|
||||||
in <strong>src</strong>, useful to sync dst with src
|
in <strong>src</strong>, useful to sync dst with src
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/atuinsh/atuin">atuin</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-atuin"
|
id="user-content-atuin"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: atuin"
|
||||||
tabindex="-1"
|
|
||||||
href="#atuin"
|
href="#atuin"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/atuinsh/atuin">atuin</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Remove duplicated command:</p>
|
<p>Remove duplicated command:</p>
|
||||||
<div class="highlight highlight-source-sql">
|
<div class="highlight highlight-source-sql">
|
||||||
<pre><span class="pl-k">delete</span>
|
<pre><span class="pl-k">delete</span>
|
||||||
|
@ -405,31 +413,35 @@ rsync -avzP src/ dst</pre>
|
||||||
<span class="pl-k">from</span> history
|
<span class="pl-k">from</span> history
|
||||||
<span class="pl-k">group by</span> command);</pre>
|
<span class="pl-k">group by</span> command);</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/ayoisaiah/f2">F2</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-f2"
|
id="user-content-f2"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: F2"
|
||||||
tabindex="-1"
|
|
||||||
href="#f2"
|
href="#f2"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/ayoisaiah/f2">F2</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Rename:</p>
|
<p>Rename:</p>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre><span class="pl-c"><span class="pl-c">#</span> If want dry run, remove -x</span>
|
<pre><span class="pl-c"><span class="pl-c">#</span> If want dry run, remove -x</span>
|
||||||
f2 -r <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}.{mtime.H}{mtime.mm}{mtime.ss}{ext}<span class="pl-pds">"</span></span> -x</pre>
|
f2 -r <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mtime.DD}.{mtime.H}{mtime.mm}{mtime.ss}{ext}<span class="pl-pds">"</span></span> -x</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/instaloader/instaloader">Instaloader</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-instaloader"
|
id="user-content-instaloader"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Instaloader"
|
||||||
tabindex="-1"
|
|
||||||
href="#instaloader"
|
href="#instaloader"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/instaloader/instaloader">Instaloader</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p><code>args.txt</code>:</p>
|
<p><code>args.txt</code>:</p>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre>
|
<pre>
|
||||||
|
@ -454,32 +466,36 @@ f2 -r <span class="pl-s"><span class="pl-pds">"</span>{mtime.YYYY}{mtime.MM}{mti
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
<pre>instaloader +login.txt +args.txt +targets.txt</pre>
|
<pre>instaloader +login.txt +args.txt +targets.txt</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/fullstorydev/grpcurl">gRPCurl</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-grpcurl"
|
id="user-content-grpcurl"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: gRPCurl"
|
||||||
tabindex="-1"
|
|
||||||
href="#grpcurl"
|
href="#grpcurl"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/fullstorydev/grpcurl">gRPCurl</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<div class="highlight highlight-source-shell">
|
<div class="highlight highlight-source-shell">
|
||||||
<pre>grpcurl -proto path/file.proto \
|
<pre>grpcurl -proto path/file.proto \
|
||||||
-d <span class="pl-s"><span class="pl-pds">'</span>{"key": "value", "timestamp": "1997-04-01T00:00:00Z"}<span class="pl-pds">'</span></span> \
|
-d <span class="pl-s"><span class="pl-pds">'</span>{"key": "value", "timestamp": "1997-04-01T00:00:00Z"}<span class="pl-pds">'</span></span> \
|
||||||
internal-social.zalopay.vn:443 \
|
internal-social.zalopay.vn:443 \
|
||||||
pkg.Service/GetData</pre>
|
pkg.Service/GetData</pre>
|
||||||
</div>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<a href="https://github.com/zed-industries/zed">Zed</a>
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-zed"
|
id="user-content-zed"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Zed"
|
||||||
tabindex="-1"
|
|
||||||
href="#zed"
|
href="#zed"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
><a href="https://github.com/zed-industries/zed">Zed</a>
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Settings:</p>
|
<p>Settings:</p>
|
||||||
<div class="highlight highlight-source-json">
|
<div class="highlight highlight-source-json">
|
||||||
<pre>{
|
<pre>{
|
||||||
|
|
|
@ -28,29 +28,29 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">F(an) android</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-fan-android"
|
id="user-content-fan-android"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: F(an) android"
|
||||||
tabindex="-1"
|
|
||||||
href="#fan-android"
|
href="#fan-android"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>F(an) android
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>You know what I mean :D</p>
|
<p>You know what I mean :D</p>
|
||||||
<p>Just a collection/checklist while using Android phone.</p>
|
<p>Just a collection/checklist while using Android phone.</p>
|
||||||
<p>All Android phones are bloat.</p>
|
<p>All Android phones are bloat.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Apps</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-apps"
|
id="user-content-apps"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Apps"
|
||||||
tabindex="-1"
|
|
||||||
href="#apps"
|
href="#apps"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Apps
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Use <a href="https://f-droid.org/en/" rel="nofollow">F-Droid</a> with
|
Use <a href="https://f-droid.org/en/" rel="nofollow">F-Droid</a> with
|
||||||
<a href="https://github.com/Droid-ify/client">Droid-ify</a> to replace
|
<a href="https://github.com/Droid-ify/client">Droid-ify</a> to replace
|
||||||
|
|
|
@ -28,27 +28,29 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Redis</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-redis"
|
id="user-content-redis"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Redis"
|
||||||
tabindex="-1"
|
|
||||||
href="#redis"
|
href="#redis"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Redis
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>Just to save my noted for future me using Redis again.</p>
|
<p>Just to save my noted for future me using Redis again.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
Redis does not store creation time of keys
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-redis-does-not-store-creation-time-of-keys"
|
id="user-content-redis-does-not-store-creation-time-of-keys"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Redis does not store creation time of keys"
|
||||||
tabindex="-1"
|
|
||||||
href="#redis-does-not-store-creation-time-of-keys"
|
href="#redis-does-not-store-creation-time-of-keys"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Redis does not store creation time of keys
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Why? Because TODO</p>
|
<p>Why? Because TODO</p>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Cache shenanigan</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-cache-shenanigan"
|
id="user-content-cache-shenanigan"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Cache shenanigan"
|
||||||
tabindex="-1"
|
|
||||||
href="#cache-shenanigan"
|
href="#cache-shenanigan"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Cache shenanigan
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
My notes/mistakes/... when using cache (mainly Redis) from time to time
|
My notes/mistakes/... when using cache (mainly Redis) from time to time
|
||||||
</p>
|
</p>
|
||||||
|
@ -84,16 +84,16 @@
|
||||||
database has new value, but cache has old value Then when we read again,
|
database has new value, but cache has old value Then when we read again,
|
||||||
we read cache first with old value, and that is disaster.
|
we read cache first with old value, and that is disaster.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">VSCode</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-vscode"
|
id="user-content-vscode"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: VSCode"
|
||||||
tabindex="-1"
|
|
||||||
href="#vscode"
|
href="#vscode"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>VSCode
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>Favortite settings everytime I install VSCode.</p>
|
<p>Favortite settings everytime I install VSCode.</p>
|
||||||
<p>
|
<p>
|
||||||
I sort JSON using
|
I sort JSON using
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Hardware 101</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-hardware-101"
|
id="user-content-hardware-101"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Hardware 101"
|
||||||
tabindex="-1"
|
|
||||||
href="#hardware-101"
|
href="#hardware-101"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Hardware 101
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Just kidding. It's only my collect data about which hardware to use/buy.
|
Just kidding. It's only my collect data about which hardware to use/buy.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Real World Crypto 101</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-real-world-crypto-101"
|
id="user-content-real-world-crypto-101"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Real World Crypto 101"
|
||||||
tabindex="-1"
|
|
||||||
href="#real-world-crypto-101"
|
href="#real-world-crypto-101"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Real World Crypto 101
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
My notes when reading
|
My notes when reading
|
||||||
<a
|
<a
|
||||||
|
@ -46,17 +46,18 @@
|
||||||
>Real-World Cryptography</a
|
>Real-World Cryptography</a
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
<strong>Hash</strong> function convert from input to digest
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-hash-function-convert-from-input-to-digest"
|
id="user-content-hash-function-convert-from-input-to-digest"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Hash function convert from input to digest"
|
||||||
tabindex="-1"
|
|
||||||
href="#hash-function-convert-from-input-to-digest"
|
href="#hash-function-convert-from-input-to-digest"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
></a>
|
></a>
|
||||||
<strong>Hash</strong> function convert from input to digest
|
</div>
|
||||||
</h2>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Pre-image resistance: Given digest, can not find input</li>
|
<li>Pre-image resistance: Given digest, can not find input</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -65,18 +66,19 @@
|
||||||
</li>
|
</li>
|
||||||
<li>Collision resistance: Can not find 2 input produce same digest.</li>
|
<li>Collision resistance: Can not find 2 input produce same digest.</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-mac-aka-message-authentication-code-produce-from-key-message-to-authentication-tag"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#mac-aka-message-authentication-code-produce-from-key-message-to-authentication-tag"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span
|
|
||||||
></a>
|
|
||||||
<strong>MAC</strong> aka Message Authentication Code produce from key,
|
<strong>MAC</strong> aka Message Authentication Code produce from key,
|
||||||
message to authentication tag.
|
message to authentication tag.
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-mac-aka-message-authentication-code-produce-from-key-message-to-authentication-tag"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: MAC aka Message Authentication Code produce from key, message to authentication tag."
|
||||||
|
href="#mac-aka-message-authentication-code-produce-from-key-message-to-authentication-tag"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>A send B message with MAC (generate from message and A key).</li>
|
<li>A send B message with MAC (generate from message and A key).</li>
|
||||||
<li>
|
<li>
|
||||||
|
@ -141,16 +143,16 @@
|
||||||
<span class="pl-ent">bob </span><span class="pl-k">-->></span> <span class="pl-ent">alice</span><span class="pl-k">:</span> <span class="pl-s">return ERROR</span></pre>
|
<span class="pl-ent">bob </span><span class="pl-k">-->></span> <span class="pl-ent">alice</span><span class="pl-k">:</span> <span class="pl-s">return ERROR</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<p><strong>HMAC</strong> is MAC using hash</p>
|
<p><strong>HMAC</strong> is MAC using hash</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">AES (Advanced Encryption Standard)</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-aes-advanced-encryption-standard"
|
id="user-content-aes-advanced-encryption-standard"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: AES (Advanced Encryption Standard)"
|
||||||
tabindex="-1"
|
|
||||||
href="#aes-advanced-encryption-standard"
|
href="#aes-advanced-encryption-standard"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>AES (Advanced Encryption Standard)
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Currently (2023) the world using AES-128 which take a key 128 bits == 16
|
Currently (2023) the world using AES-128 which take a key 128 bits == 16
|
||||||
bytes
|
bytes
|
||||||
|
@ -165,16 +167,16 @@
|
||||||
<strong>block cipher</strong>. AES is deterministic so we can encrypt and
|
<strong>block cipher</strong>. AES is deterministic so we can encrypt and
|
||||||
decrypt.
|
decrypt.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">AES-CBC (Cipher Block Chaining)</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-aes-cbc-cipher-block-chaining"
|
id="user-content-aes-cbc-cipher-block-chaining"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: AES-CBC (Cipher Block Chaining)"
|
||||||
tabindex="-1"
|
|
||||||
href="#aes-cbc-cipher-block-chaining"
|
href="#aes-cbc-cipher-block-chaining"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>AES-CBC (Cipher Block Chaining)
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
What if text you want to encrypt longer than 128 bytes ? We add
|
What if text you want to encrypt longer than 128 bytes ? We add
|
||||||
<strong>padding</strong> for text to become multi block which has 128
|
<strong>padding</strong> for text to become multi block which has 128
|
||||||
|
@ -220,31 +222,33 @@
|
||||||
<strong>WARNING</strong> If IV become predictable, AES-CBC become
|
<strong>WARNING</strong> If IV become predictable, AES-CBC become
|
||||||
deterministic -> BEAST attack (Browser Exploit Against SSL/TLS).
|
deterministic -> BEAST attack (Browser Exploit Against SSL/TLS).
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
|
AEAD (Authenticated Encryption with Associated Data)
|
||||||
|
</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-aead-authenticated-encryption-with-associated-data"
|
id="user-content-aead-authenticated-encryption-with-associated-data"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: AEAD (Authenticated Encryption with Associated Data)"
|
||||||
tabindex="-1"
|
|
||||||
href="#aead-authenticated-encryption-with-associated-data"
|
href="#aead-authenticated-encryption-with-associated-data"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>AEAD (Authenticated Encryption with Associated Data)
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Because AES-CBC requires IV which shows public -> attacker can change
|
Because AES-CBC requires IV which shows public -> attacker can change
|
||||||
IV -> lack of authenticity -> use AES-CBC-HMAC or AEAD.
|
IV -> lack of authenticity -> use AES-CBC-HMAC or AEAD.
|
||||||
</p>
|
</p>
|
||||||
<p>AEAD provides a way to authenticate <strong>associated data</strong>.</p>
|
<p>AEAD provides a way to authenticate <strong>associated data</strong>.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">AES-GCM (Galois/Counter Mode) AEAD</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-aes-gcm-galoiscounter-mode-aead"
|
id="user-content-aes-gcm-galoiscounter-mode-aead"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: AES-GCM (Galois/Counter Mode) AEAD"
|
||||||
tabindex="-1"
|
|
||||||
href="#aes-gcm-galoiscounter-mode-aead"
|
href="#aes-gcm-galoiscounter-mode-aead"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>AES-GCM (Galois/Counter Mode) AEAD
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>AES-GCM = AES-CTR (Counter) + GMAC message authentication code</p>
|
<p>AES-GCM = AES-CTR (Counter) + GMAC message authentication code</p>
|
||||||
<p>AES-CTR encrypt:</p>
|
<p>AES-CTR encrypt:</p>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -266,16 +270,16 @@
|
||||||
</p>
|
</p>
|
||||||
<p>This is stream cipher, differ from block cipher.</p>
|
<p>This is stream cipher, differ from block cipher.</p>
|
||||||
<p>GMAC is MAC with GHASH. GHASH resembles CBC mode.</p>
|
<p>GMAC is MAC with GHASH. GHASH resembles CBC mode.</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">ChaCha20-Poly1305 AED</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-chacha20-poly1305-aed"
|
id="user-content-chacha20-poly1305-aed"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: ChaCha20-Poly1305 AED"
|
||||||
tabindex="-1"
|
|
||||||
href="#chacha20-poly1305-aed"
|
href="#chacha20-poly1305-aed"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>ChaCha20-Poly1305 AED
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>ChaCha20-Poly1305 = ChaCha20 stream cipher + Poly1305 MAC</p>
|
<p>ChaCha20-Poly1305 = ChaCha20 stream cipher + Poly1305 MAC</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -28,26 +28,26 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Vietnam survivor</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-vietnam-survivor"
|
id="user-content-vietnam-survivor"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Vietnam survivor"
|
||||||
tabindex="-1"
|
|
||||||
href="#vietnam-survivor"
|
href="#vietnam-survivor"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Vietnam survivor
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Giấy tờ</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-giấy-tờ"
|
id="user-content-giấy-tờ"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Giấy tờ"
|
||||||
tabindex="-1"
|
|
||||||
href="#giấy-tờ"
|
href="#giấy-tờ"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Giấy tờ
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Chứng minh nhân dân <strong>CMND</strong></li>
|
<li>Chứng minh nhân dân <strong>CMND</strong></li>
|
||||||
<li>Căn cước công dân <strong>CCCD</strong></li>
|
<li>Căn cước công dân <strong>CCCD</strong></li>
|
||||||
|
@ -56,16 +56,16 @@
|
||||||
<li>Bảo hiểm xã hội <strong>BHXH</strong></li>
|
<li>Bảo hiểm xã hội <strong>BHXH</strong></li>
|
||||||
<li>Giấy phép lái xe <strong>GPLX</strong></li>
|
<li>Giấy phép lái xe <strong>GPLX</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">CMND/CCCD</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-cmndcccd"
|
id="user-content-cmndcccd"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: CMND/CCCD"
|
||||||
tabindex="-1"
|
|
||||||
href="#cmndcccd"
|
href="#cmndcccd"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>CMND/CCCD
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Làm tại Công an quận, huyện, thành phố.</p>
|
<p>Làm tại Công an quận, huyện, thành phố.</p>
|
||||||
<p>
|
<p>
|
||||||
Sử dụng
|
Sử dụng
|
||||||
|
@ -84,26 +84,26 @@
|
||||||
Công an ... làm lại.
|
Công an ... làm lại.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Passport</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-passport"
|
id="user-content-passport"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Passport"
|
||||||
tabindex="-1"
|
|
||||||
href="#passport"
|
href="#passport"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Passport
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">BHXH</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-bhxh"
|
id="user-content-bhxh"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: BHXH"
|
||||||
tabindex="-1"
|
|
||||||
href="#bhxh"
|
href="#bhxh"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>BHXH
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<a
|
<a
|
||||||
href="https://baohiemxahoi.gov.vn/tracuu/Pages/tra-cuu-ho-gia-dinh.aspx"
|
href="https://baohiemxahoi.gov.vn/tracuu/Pages/tra-cuu-ho-gia-dinh.aspx"
|
||||||
|
@ -150,16 +150,16 @@
|
||||||
thất nghiệp: Điều kiện, mức hưởng, thủ tục hưởng)
|
thất nghiệp: Điều kiện, mức hưởng, thủ tục hưởng)
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">GPLX</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-gplx"
|
id="user-content-gplx"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: GPLX"
|
||||||
tabindex="-1"
|
|
||||||
href="#gplx"
|
href="#gplx"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>GPLX
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Nếu mất:</p>
|
<p>Nếu mất:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -28,16 +28,16 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Bloguru</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-bloguru"
|
id="user-content-bloguru"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Bloguru"
|
||||||
tabindex="-1"
|
|
||||||
href="#bloguru"
|
href="#bloguru"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Bloguru
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>No intro, this is list of RSS reader I follow:</p>
|
<p>No intro, this is list of RSS reader I follow:</p>
|
||||||
<p>Not personal blogs:</p>
|
<p>Not personal blogs:</p>
|
||||||
<div class="highlight highlight-text-adblock">
|
<div class="highlight highlight-text-adblock">
|
||||||
|
|
|
@ -28,34 +28,36 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Unrelated engineer</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-unrelated-engineer"
|
id="user-content-unrelated-engineer"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Unrelated engineer"
|
||||||
tabindex="-1"
|
|
||||||
href="#unrelated-engineer"
|
href="#unrelated-engineer"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Unrelated engineer
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
This is collect of thoughts after I travel around the Internet. Not
|
This is collect of thoughts after I travel around the Internet. Not
|
||||||
engineering related though.
|
engineering related though.
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">
|
||||||
<a
|
<a
|
||||||
id="user-content-give-it-five-minutes"
|
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#give-it-five-minutes"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a
|
|
||||||
href="https://signalvnoise.com/posts/3124-give-it-five-minutes"
|
href="https://signalvnoise.com/posts/3124-give-it-five-minutes"
|
||||||
rel="nofollow"
|
rel="nofollow"
|
||||||
>Give it five minutes</a
|
>Give it five minutes</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-give-it-five-minutes"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Give it five minutes"
|
||||||
|
href="#give-it-five-minutes"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>
|
<p>
|
||||||
There are two things in this world that take no skill: 1. Spending other
|
There are two things in this world that take no skill: 1. Spending other
|
||||||
|
@ -76,18 +78,20 @@
|
||||||
there too: It may be worth it.
|
there too: It may be worth it.
|
||||||
</p>
|
</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
<a
|
<h2 class="heading-element">
|
||||||
id="user-content-never-say-no-but-rarely-say-yes"
|
<a href="https://longform.asmartbear.com/say-yes/" rel="nofollow"
|
||||||
class="anchor"
|
|
||||||
aria-hidden="true"
|
|
||||||
tabindex="-1"
|
|
||||||
href="#never-say-no-but-rarely-say-yes"
|
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
|
||||||
><a href="https://longform.asmartbear.com/say-yes/" rel="nofollow"
|
|
||||||
>Never say “no,” but rarely say “yes.”</a
|
>Never say “no,” but rarely say “yes.”</a
|
||||||
>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
|
<a
|
||||||
|
id="user-content-never-say-no-but-rarely-say-yes"
|
||||||
|
class="anchor-element"
|
||||||
|
aria-label="Permalink: Never say “no,” but rarely say “yes.”"
|
||||||
|
href="#never-say-no-but-rarely-say-yes"
|
||||||
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
|
></a>
|
||||||
|
</div>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>
|
<p>
|
||||||
So the principle is straightforward: Set the conditions of “yes” such
|
So the principle is straightforward: Set the conditions of “yes” such
|
||||||
|
|
|
@ -28,27 +28,27 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Debounce</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-debounce"
|
id="user-content-debounce"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Debounce"
|
||||||
tabindex="-1"
|
|
||||||
href="#debounce"
|
href="#debounce"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Debounce
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>TODO</p>
|
<p>TODO</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Thanks</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-thanks"
|
id="user-content-thanks"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Thanks"
|
||||||
tabindex="-1"
|
|
||||||
href="#thanks"
|
href="#thanks"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Thanks
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -28,26 +28,26 @@
|
||||||
<h2>
|
<h2>
|
||||||
<a href="index.html"><code>~</code></a>
|
<a href="index.html"><code>~</code></a>
|
||||||
</h2>
|
</h2>
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Backend Thinking</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-backend-thinking"
|
id="user-content-backend-thinking"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Backend Thinking"
|
||||||
tabindex="-1"
|
|
||||||
href="#backend-thinking"
|
href="#backend-thinking"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Backend Thinking
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Backend Role</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-backend-role"
|
id="user-content-backend-role"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Backend Role"
|
||||||
tabindex="-1"
|
|
||||||
href="#backend-role"
|
href="#backend-role"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Backend Role
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Transform business requirements to action, which usually involves:</p>
|
<p>Transform business requirements to action, which usually involves:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -126,28 +126,28 @@
|
||||||
<em>Example</em>: Business requirements says: Must match/compare user EKYC
|
<em>Example</em>: Business requirements says: Must match/compare user EKYC
|
||||||
data with Bank data (name, dob, id, ...).
|
data with Bank data (name, dob, id, ...).
|
||||||
</p>
|
</p>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Technical side</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-technical-side"
|
id="user-content-technical-side"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Technical side"
|
||||||
tabindex="-1"
|
|
||||||
href="#technical-side"
|
href="#technical-side"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Technical side
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Backend services talk to Frontend, and talk to each other.</p>
|
<p>Backend services talk to Frontend, and talk to each other.</p>
|
||||||
<p>How do they communicate?</p>
|
<p>How do they communicate?</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">API</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-api"
|
id="user-content-api"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: API"
|
||||||
tabindex="-1"
|
|
||||||
href="#api"
|
href="#api"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>API
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<strong>First</strong> is through API, this is the direct way, you send a
|
<strong>First</strong> is through API, this is the direct way, you send a
|
||||||
request then you wait for response.
|
request then you wait for response.
|
||||||
|
@ -200,16 +200,16 @@
|
||||||
for switch is mainly performance.
|
for switch is mainly performance.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Message Broker</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-message-broker"
|
id="user-content-message-broker"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Message Broker"
|
||||||
tabindex="-1"
|
|
||||||
href="#message-broker"
|
href="#message-broker"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Message Broker
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<strong>Second</strong> way is by Message Broker, the most well known is
|
<strong>Second</strong> way is by Message Broker, the most well known is
|
||||||
Kafka.
|
Kafka.
|
||||||
|
@ -264,16 +264,16 @@
|
||||||
<span class="pl-ent">D </span><span class="pl-k">->></span> <span class="pl-ent">Kafka</span><span class="pl-k">:</span> <span class="pl-s">consume message</span>
|
<span class="pl-ent">D </span><span class="pl-k">->></span> <span class="pl-ent">Kafka</span><span class="pl-k">:</span> <span class="pl-s">consume message</span>
|
||||||
<span class="pl-ent">D </span><span class="pl-k">->></span> <span class="pl-ent">D</span><span class="pl-k">:</span> <span class="pl-s">do something</span></pre>
|
<span class="pl-ent">D </span><span class="pl-k">->></span> <span class="pl-ent">D</span><span class="pl-k">:</span> <span class="pl-s">do something</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Tip</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-tip"
|
id="user-content-tip"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Tip"
|
||||||
tabindex="-1"
|
|
||||||
href="#tip"
|
href="#tip"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Tip
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Whatever you design, you stick with it consistently. Don't use different
|
Whatever you design, you stick with it consistently. Don't use different
|
||||||
|
@ -296,16 +296,16 @@
|
||||||
<strong>Pro tip</strong>: Use proto to define models (if you can) to take
|
<strong>Pro tip</strong>: Use proto to define models (if you can) to take
|
||||||
advantage of detecting breaking changes.
|
advantage of detecting breaking changes.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">References</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-references"
|
id="user-content-references"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: References"
|
||||||
tabindex="-1"
|
|
||||||
href="#references"
|
href="#references"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>References
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -333,32 +333,32 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Coding principle</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-coding-principle"
|
id="user-content-coding-principle"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Coding principle"
|
||||||
tabindex="-1"
|
|
||||||
href="#coding-principle"
|
href="#coding-principle"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Coding principle
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
You should know about DRY, SOLID, KISS, YAGNI, Design Pattern. The basic
|
You should know about DRY, SOLID, KISS, YAGNI, Design Pattern. The basic
|
||||||
is learning which is which when you read code. Truly understand will be
|
is learning which is which when you read code. Truly understand will be
|
||||||
knowing when to use and when to not.
|
knowing when to use and when to not.
|
||||||
</p>
|
</p>
|
||||||
<p>All of these above are industry standard.</p>
|
<p>All of these above are industry standard.</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Write code that is easy delete</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-write-code-that-is-easy-delete"
|
id="user-content-write-code-that-is-easy-delete"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Write code that is easy delete"
|
||||||
tabindex="-1"
|
|
||||||
href="#write-code-that-is-easy-delete"
|
href="#write-code-that-is-easy-delete"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Write code that is easy delete
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
The way business moving is fast, so a feature is maybe implemented today,
|
The way business moving is fast, so a feature is maybe implemented today,
|
||||||
but gets thrown out of window tomorrow (Like A/B testing, one of them is
|
but gets thrown out of window tomorrow (Like A/B testing, one of them is
|
||||||
|
@ -408,16 +408,16 @@
|
||||||
And when we do not need send noti anymore, we can delete whole of it which
|
And when we do not need send noti anymore, we can delete whole of it which
|
||||||
includes all providers and still not affecting main flow.
|
includes all providers and still not affecting main flow.
|
||||||
</p>
|
</p>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">Write code that is easy to test</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-write-code-that-is-easy-to-test"
|
id="user-content-write-code-that-is-easy-to-test"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Write code that is easy to test"
|
||||||
tabindex="-1"
|
|
||||||
href="#write-code-that-is-easy-to-test"
|
href="#write-code-that-is-easy-to-test"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Write code that is easy to test
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
Test is not a way to find bug, but to make sure what we code is actually
|
Test is not a way to find bug, but to make sure what we code is actually
|
||||||
what we think/expect.
|
what we think/expect.
|
||||||
|
@ -475,16 +475,16 @@
|
||||||
tests are wrong/not enough (tests is missing some code path).
|
tests are wrong/not enough (tests is missing some code path).
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">References</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-references-1"
|
id="user-content-references-1"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: References"
|
||||||
tabindex="-1"
|
|
||||||
href="#references-1"
|
href="#references-1"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>References
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
|
@ -508,16 +508,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">System Design Concept</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-system-design-concept"
|
id="user-content-system-design-concept"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: System Design Concept"
|
||||||
tabindex="-1"
|
|
||||||
href="#system-design-concept"
|
href="#system-design-concept"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>System Design Concept
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<p>Start with basic: getting data from database.</p>
|
<p>Start with basic: getting data from database.</p>
|
||||||
<div class="highlight highlight-source-mermaid">
|
<div class="highlight highlight-source-mermaid">
|
||||||
<pre><span class="pl-k">sequenceDiagram</span>
|
<pre><span class="pl-k">sequenceDiagram</span>
|
||||||
|
@ -562,16 +562,16 @@
|
||||||
<span class="pl-ent">service </span><span class="pl-k">->></span> <span class="pl-ent">database</span><span class="pl-k">:</span> <span class="pl-s">set</span>
|
<span class="pl-ent">service </span><span class="pl-k">->></span> <span class="pl-ent">database</span><span class="pl-k">:</span> <span class="pl-s">set</span>
|
||||||
<span class="pl-ent">service </span><span class="pl-k">->></span> <span class="pl-ent">cache</span><span class="pl-k">:</span> <span class="pl-s">set</span></pre>
|
<span class="pl-ent">service </span><span class="pl-k">->></span> <span class="pl-ent">cache</span><span class="pl-k">:</span> <span class="pl-s">set</span></pre>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<div class="markdown-heading">
|
||||||
|
<h3 class="heading-element">References</h3>
|
||||||
<a
|
<a
|
||||||
id="user-content-references-2"
|
id="user-content-references-2"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: References"
|
||||||
tabindex="-1"
|
|
||||||
href="#references-2"
|
href="#references-2"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>References
|
></a>
|
||||||
</h3>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://apenwarr.ca/log/20201227" rel="nofollow"
|
<a href="https://apenwarr.ca/log/20201227" rel="nofollow"
|
||||||
|
@ -603,16 +603,16 @@
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>
|
<div class="markdown-heading">
|
||||||
|
<h2 class="heading-element">Bonus</h2>
|
||||||
<a
|
<a
|
||||||
id="user-content-bonus"
|
id="user-content-bonus"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Bonus"
|
||||||
tabindex="-1"
|
|
||||||
href="#bonus"
|
href="#bonus"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Bonus
|
></a>
|
||||||
</h2>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<a href="https://www.jetbrains.com/idea/download/" rel="nofollow"
|
<a href="https://www.jetbrains.com/idea/download/" rel="nofollow"
|
||||||
|
|
|
@ -25,16 +25,16 @@
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<body class="markdown-body">
|
<body class="markdown-body">
|
||||||
<h1>
|
<div class="markdown-heading">
|
||||||
|
<h1 class="heading-element">Index</h1>
|
||||||
<a
|
<a
|
||||||
id="user-content-index"
|
id="user-content-index"
|
||||||
class="anchor"
|
class="anchor-element"
|
||||||
aria-hidden="true"
|
aria-label="Permalink: Index"
|
||||||
tabindex="-1"
|
|
||||||
href="#index"
|
href="#index"
|
||||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||||
>Index
|
></a>
|
||||||
</h1>
|
</div>
|
||||||
<p>This is where I dump my thoughts.</p>
|
<p>This is where I dump my thoughts.</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="2022-06-08-backup.html">Backup my way</a></li>
|
<li><a href="2022-06-08-backup.html">Backup my way</a></li>
|
||||||
|
|
|
@ -145,6 +145,7 @@ Format
|
||||||
Language server
|
Language server
|
||||||
|
|
||||||
- https://github.com/golang/tools/tree/master/gopls
|
- https://github.com/golang/tools/tree/master/gopls
|
||||||
|
- https://github.com/Microsoft/pyright
|
||||||
|
|
||||||
Misc
|
Misc
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue