Skip to content

Commit a79a51c

Browse files
committed
Add cloud limits cheatsheet
1 parent 377c047 commit a79a51c

File tree

10 files changed

+56
-13
lines changed

10 files changed

+56
-13
lines changed

lib/components_guide_web.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ defmodule ComponentsGuideWeb do
5656
@opts Keyword.merge(
5757
[
5858
layout: {ComponentsGuideWeb.LayoutView, "live.html"},
59-
container: {:div, class: "relative h-screen flex overflow-hidden bg-white"}
59+
container: {:div, class: "relative h-screen flex overflow-hidden"}
6060
],
6161
unquote(opts)
6262
)

lib/components_guide_web/controllers/cheatsheets_controller.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule ComponentsGuideWeb.CheatsheetsController do
1414
render(conn, "index.html", article: "intro", wasm_constant: @wasm_constant)
1515
end
1616

17-
@articles ["rxjs", "error-messages"]
17+
@articles ["rxjs", "error-messages", "cloud-limits"]
1818

1919
def show(conn, %{"id" => article}) when article in @articles do
2020
render(conn, "index.html", article: article)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<header style="<%= header_styles() %>">
1+
<header class="<%= ComponentsGuideWeb.TopicsView.class_for_topic(:cheatsheets) %>">
22
<%= render ComponentsGuideWeb.CheatsheetsView, "_top.html" %>
33
</header>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<nav class="pt-6 pb-4">
2-
<ul y-y x-x=md class="text-xl font-bold text-shadow" data-links="p-3">
3-
<li><%= link("Intro", to: '/cheatsheets') %>
2+
<ul y-y x-x=md class="text-xl font-bold" data-links="p-3">
43
<li><%= link("Error Messages", to: '/cheatsheets/error-messages') %>
4+
<li><%= link("Cloud Limits", to: '/cheatsheets/cloud-limits') %>
55
<li><%= link("RxJS", to: '/cheatsheets/rxjs') %>
66
</ul>
77
</nav>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<div class="mx-auto max-w-4xl text-white">
2-
<h2 y-y x-x=md class="pt-8 row space-x-4 text-4xl text-center font-bold leading-tight text-shadow">
3-
<span class="mr-1 text-5xl">🧶💝</span>
4-
<span><%= "Library Cheatsheets" %></span>
5-
</h2>
1+
<div class="mx-auto max-w-4xl">
2+
<h1 y-y x-x=md class="pt-8 row space-x-4 text-4xl text-center font-bold leading-tight">
3+
<span class="mr-1 text-5xl">🐝💨</span>
4+
<span><%= "Cheatsheets" %></span>
5+
</h1>
66
<%= render ComponentsGuideWeb.CheatsheetsView, "_nav.html" %>
77
</div>
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Cloud Limits
2+
3+
## Storage
4+
5+
<svg viewbox="0 0 24 16" width="480" height="360" class="border border-gray-800 rounded-lg">
6+
<title>Cloud Storage Limits</title>
7+
<g fill="#eb4859">
8+
<circle cx="5" cy="2" r="<%= :math.sqrt(0.065 / :math.pi()) %>" />
9+
<circle cx="5" cy="4.2" r="<%= :math.sqrt(0.4 / :math.pi()) %>" />
10+
<circle cx="5" cy="6.5" r="<%= :math.sqrt(1.048 / :math.pi()) %>" />
11+
<circle cx="5" cy="11.5" r="<%= :math.sqrt(26.12 / :math.pi()) %>" />
12+
</g>
13+
<g fill="currentColor" style="font-size: 1px; alignment-baseline: central;">
14+
<text x="6" y="2.3" class="small">TCP packet: 64KiB</text>
15+
<text x="6.3" y="4.5" class="small">DynamoDB attribute: 400KB</text>
16+
<text x="6.6" y="6.8" class="small">GCP Datastore entity: ~1MiB</text>
17+
<text x="9" y="11.8" class="small">Cloudflare KV entry: 25MiB</text>
18+
</g>
19+
</svg>
20+
21+
- TCP packet: 65,535 bytes (64KiB - 1 byte)
22+
- Max size of DynamoDB attribute key & value: 400KB
23+
- Max size of GCP Datastore entity: 1,048,572 bytes (1MiB - 4 bytes)
24+
- Max size of Cloudflare KV entry: 25MiB
25+
- Max size of Gmail attachment: 25MiB
26+
- Max size of S3 Object: 5TB
27+
- Max size of single PUT: 5GB
28+
- Multipart upload part size: 5MiB to 5GiB
29+
- S3 Metadata: 2KB
30+
31+
----
32+
33+
<svg viewbox="0 0 20 10" width="500" height="250">
34+
<g fill="#d1272e">
35+
<circle cx="2" cy="4" r="<%= :math.sqrt(0.065 / :math.pi()) %>" />
36+
<circle cx="4" cy="4" r="<%= :math.sqrt(0.4 / :math.pi()) %>" />
37+
<circle cx="7" cy="4" r="<%= :math.sqrt(1.048 / :math.pi()) %>" />
38+
<circle cx="13" cy="4" r="<%= :math.sqrt(26.12 / :math.pi()) %>" />
39+
</g>
40+
</svg>

lib/components_guide_web/templates/landing/index.html.eex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ header_links = [
5959

6060
<%= subject_banner(:accessibility_first) %>
6161
<%= subject_banner(:react_typescript) %>
62-
<%= subject_banner(:robust_javascript_interactivity) %>
6362
<%= subject_banner(:web_standards) %>
6463
<%= subject_banner(:composable_systems) %>
64+
<%= subject_banner(:cheatsheets) %>
65+
<%= subject_banner(:robust_javascript_interactivity) %>
6566

6667
<div hidden class="text-white">
6768
<section class="pt-20 pb-20" style="<%= sections_styles(:dark) %>">

lib/components_guide_web/templates/layout/_contentinfo.html.eex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<footer role="contentinfo" class="container pt-16 pb-6 text-gray-500 border-t border-gray-800 tracking-wide">
2-
<div class="text-center text-xl text-white" style="--link-decoration: underline">
2+
<div class="text-center text-xl text-white" data-links="underline-on-hover">
33
Follow <a href="https://twitter.com/ComponentsGuide">@ComponentsGuide</a> on Twitter for the latest articles.
44
</div>
55

lib/components_guide_web/views/landing_view.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ defmodule ComponentsGuideWeb.LandingView do
99
do: ComponentsGuideWeb.RobustJavascriptInteractivityView
1010

1111
defp subject_to_module(:web_standards), do: ComponentsGuideWeb.WebStandardsView
12+
defp subject_to_module(:cheatsheets), do: ComponentsGuideWeb.CheatsheetsView
1213
defp subject_to_module(:composable_systems), do: ComponentsGuideWeb.ComposableSystemsView
1314

1415
def subject_banner(subject) do

lib/components_guide_web/views/topics_view.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ defmodule ComponentsGuideWeb.TopicsView do
1212
react_typescript: "bg-blue-200",
1313
robust_javascript_interactivity: "bg-orange-200",
1414
web_standards: "bg-yellow-200",
15-
composable_systems: "bg-green-200",
15+
composable_systems: "bg-lime-200",
16+
cheatsheets: "bg-teal-200",
1617
}
1718

1819
def class_for_topic(topic), do: @backgrounds[topic]

0 commit comments

Comments
 (0)