Skip to content

Instantly share code, notes, and snippets.

View ngocongcan's full-sized avatar
🏠
Working from home

Can Ngo ngocongcan

🏠
Working from home
  • Da nang, Vietname
View GitHub Profile
@ngocongcan
ngocongcan / clean_code.md
Created August 13, 2022 03:58 — 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

@ngocongcan
ngocongcan / valet.conf
Created April 13, 2020 15:02 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@ngocongcan
ngocongcan / base64-typescript-class.ts
Created March 8, 2017 17:41 — forked from Juszczak/base64-typescript-class.ts
TypeScript class for Base64 encoding/decoding
class Base64 {
private PADCHAR: string = '=';
private ALPHA: string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
private getByte(s: string, i: number): number {
const x = s.charCodeAt(i);
return x;
}
private getByte64(s: string, i: number): number {
{
"DoiThuNhat": {
"HoTen" : "Ngô Công Đức",
"DoiThuHai":
[
{
"HoTen" : "Ngô Công Mui (Đời thứ 2)",
"DoiThuBa": [
{
"HoTen" : "Ngô Công Mui (Cần) - Đời thứ 3",