Skip to content

Instantly share code, notes, and snippets.

View gu-hy's full-sized avatar
🎱
And remember, respect is everything

Guhy gu-hy

🎱
And remember, respect is everything
View GitHub Profile
@gu-hy
gu-hy / clean_code.md
Created October 6, 2023 10:29 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@gu-hy
gu-hy / example-vault-admin-policy.hcl
Created April 8, 2022 08:23 — forked from kawsark/example-vault-admin-policy.hcl
An example Vault admin policy with capability to manage leses
# Allow managing leases
path "sys/leases/*"
{
capabilities = ["create", "read", "update", "delete", "list", "sudo"]
}
# Manage auth methods broadly across Vault
path "auth/*"
{
capabilities = ["create", "read", "update", "delete", "list", "sudo"]
@gu-hy
gu-hy / ttfb.sh
Created November 4, 2021 12:51 — forked from sandeepraju/ttfb.sh
curl command to check the time to first byte
#!/bin/bash
# file: ttfb.sh
# curl command to check the time to first byte
# ** usage **
# 1. ./ttfb.sh "https://google.com"
# 2. seq 10 | xargs -Iz ./ttfb.sh "https://google.com"
curl -o /dev/null \
-H 'Cache-Control: no-cache' \
-s \