feat: add namings
parent
642a498cee
commit
c4eb10818f
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown-dark.min.css"
|
||||
/>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family=Inter&family=JetBrains+Mono&family=Martian+Mono&family=Recursive&display=swap"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
<title>haunt98 posts</title>
|
||||
</head>
|
||||
<style>
|
||||
.markdown-body {
|
||||
box-sizing: border-box;
|
||||
min-width: 200px;
|
||||
max-width: 980px;
|
||||
margin: 0 auto;
|
||||
padding: 45px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.markdown-body {
|
||||
padding: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.markdown-body {
|
||||
font-family: "Inter", sans-serif;
|
||||
<!-- font-family: "Recursive", sans-serif; -->
|
||||
}
|
||||
|
||||
.markdown-body code,
|
||||
.markdown-body pre {
|
||||
font-family: "JetBrains Mono", monospace;
|
||||
<!-- font-family: "Martian Mono", monospace; -->
|
||||
}
|
||||
</style>
|
||||
<body class="markdown-body">
|
||||
<div><a href="index">Index</a></div>
|
||||
<h1>
|
||||
<a
|
||||
id="user-content-naming-things"
|
||||
class="anchor"
|
||||
aria-hidden="true"
|
||||
href="#naming-things"
|
||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
||||
>Naming things
|
||||
</h1>
|
||||
<h2>
|
||||
<a
|
||||
id="user-content-filename-in-storage-s3-"
|
||||
class="anchor"
|
||||
aria-hidden="true"
|
||||
href="#filename-in-storage-s3-"
|
||||
><span aria-hidden="true" class="octicon octicon-link"></span></a
|
||||
>Filename in storage (S3, ...)
|
||||
</h2>
|
||||
<p>Always have year, month, day in filename to easily sort it out.</p>
|
||||
<p>
|
||||
If file is uploaded by user, add <code>user_id</code> in filename, or some
|
||||
other unique identifier depends on your business in which you require to
|
||||
upload.
|
||||
</p>
|
||||
<p>
|
||||
Personally, I always add timestamp and extra data in filename to avoid
|
||||
duplicate.
|
||||
</p>
|
||||
<p>
|
||||
Example filename:
|
||||
<code>yyyy/mm/dd/{user_id}-{timestamp}-{extra}.ext</code>
|
||||
</p>
|
||||
<p>
|
||||
Be careful with <code>/</code>, too much nested folder is no good for
|
||||
backup (as they say, idk if true or not, but less folder mean less
|
||||
complicated to me).
|
||||
</p>
|
||||
|
||||
<div>
|
||||
Feel free to ask me via
|
||||
<a href="mailto:hauvipapro+posts@gmail.com">email</a> or
|
||||
<a rel="me" href="https://hachyderm.io/@haunguyen">Mastodon</a>. Source
|
||||
code is available on
|
||||
<a href="https://github.com/haunt98/posts-go">GitHub</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -65,6 +65,7 @@
|
|||
<li><a href="2023-03-05-incident">Incident come and go</a></li>
|
||||
<li><a href="2023-03-30-fonts">Fonts</a></li>
|
||||
<li><a href="2023-04-01-games">Games 4 fun</a></li>
|
||||
<li><a href="2023-04-17-naming">Naming</a></li>
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
# Naming things
|
||||
|
||||
## Filename in storage (S3, ...)
|
||||
|
||||
Always have year, month, day in filename to easily sort it out.
|
||||
|
||||
If file is uploaded by user, add `user_id` in filename, or some other unique identifier depends on your business in which you require to upload.
|
||||
|
||||
Personally, I always add timestamp and extra data in filename to avoid duplicate.
|
||||
|
||||
Example filename: `yyyy/mm/dd/{user_id}-{timestamp}-{extra}.ext`
|
||||
|
||||
Be careful with `/`, too much nested folder is no good for backup (as they say, idk if true or not, but less folder mean less complicated to me).
|
|
@ -16,3 +16,4 @@ This is where I dump my thoughts.
|
|||
- [Incident come and go](2023-03-05-incident)
|
||||
- [Fonts](2023-03-30-fonts)
|
||||
- [Games 4 fun](2023-04-01-games)
|
||||
- [Naming](2023-04-17-naming)
|
||||
|
|
Loading…
Reference in New Issue