Skip to content

Instantly share code, notes, and snippets.

View sleepylee's full-sized avatar
😒
Focusing

Trung Le sleepylee

😒
Focusing
  • nimblehq
  • Bangkok
View GitHub Profile
@sleepylee
sleepylee / clean_code.md
Created November 15, 2024 07:19 — 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

@sleepylee
sleepylee / regexCheatsheet.js
Created April 8, 2019 15:24 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@sleepylee
sleepylee / howto-installing-vault-on-aws-linux.md
Last active August 9, 2018 08:35 — forked from cludden/howto-installing-vault-on-aws-linux.md
HOWTO: Installing Vault on AWS Linux

HOWTO: Installing Vault On AWS Linux

This is quick howto for installing vault on AWS Amazon Linux AMI, so the setup can be replicated easily without the concerns of detailed steps on securing. At the end of this tutorial, you'll have a working vault server, using s3 for the backend, ensure the vault server is always running, and starts on reboot.

Setting up S3

First things first, let's set up an S3 bucket to use as the storage backend for our S3 instance.

  1. From the AWS Mangement Console, go to the S3 console.

  2. Click on the Create Bucket button

@sleepylee
sleepylee / jenkins.md
Created June 6, 2017 10:41 — forked from wagnerjgoncalves/jenkins.md
Shell Script to install Jenkins at Ubuntu