This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example-1 */ | |
// Without null coalescing assignment operator | |
string name = null; | |
if (name == null) | |
{ | |
name = "Unknown"; | |
} | |
// With null coalescing assignment operator | |
string name ??= "Unknown"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example-1 */ | |
// Without null forgiving or null suppression operator | |
string name = null; // WARNING | |
// With null forgiving or null suppression operator | |
string name = null!; // NO WARNING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example-1 */ | |
// Without ternary conditional operator | |
int age = 25; | |
string type; | |
if (age >= 18) | |
{ | |
type = "Adult"; | |
} | |
else | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example-1 */ | |
// Without null coalescing operator | |
string name = GetUserName(); | |
if (name == null) | |
{ | |
name = "Unknown"; | |
} | |
// With null coalescing operator | |
string name = GetUserName() ?? "Unknown"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
labels: | |
app: myapp | |
name: myapp | |
spec: | |
containers: | |
- name: myapp | |
image: k8s.gcr.io/myapp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PROJECT-DIRECTORY/ | |
-- modules/ | |
-- <service1-name>/ | |
-- main.tf | |
-- variables.tf | |
-- outputs.tf | |
-- provider.tf | |
-- README | |
-- <service2-name>/ | |
-- main.tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/bc1188d2a4b8d5295890e9c5438b9ce4 | |
################################# | |
# 10 Must-Have Kubernetes Tools # | |
# https://youtu.be/CB79eTFbR0w # | |
################################# | |
# Additional Info: | |
# - How To Replace Docker With nerdctl And Rancher Desktop: https://youtu.be/evWPib0iNgY | |
# - k9s Kubernetes UI - A Terminal-Based Vim-Like Kubernetes Dashboard: https://youtu.be/boaW9odvRCc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# initialize terraform configuration | |
terraform init | |
# validate terraform configuration | |
terraform validate | |
# create terraform plan | |
terraform plan -out state.tfplan | |
# apply terraform plan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
output "cluster_name" { | |
value = aws_eks_cluster.this.name | |
} | |
output "cluster_endpoint" { | |
value = aws_eks_cluster.this.endpoint | |
} | |
output "cluster_ca_certificate" { | |
value = aws_eks_cluster.this.certificate_authority[0].data |
NewerOlder