Skip to content

Instantly share code, notes, and snippets.

View anhtuank7c's full-sized avatar

Tuan Nguyen anhtuank7c

View GitHub Profile
anhtuank7c /
Created April 8, 2024 10:28 — forked from nd3w/
How to Install Nginx, MariaDB, PHP-FPM on Ubuntu 20.04

How to Install Nginx, MariaDB, PHP-FPM on Ubuntu 20.04

This is a way to install and set up Nginx, MariaDB and PHP-FPM on Ubuntu 20.04.

NOTE: This has been prepared for ease of use in mind, not security, mostly in development machine. Please do not use these instructions to setup on a public server environment. Use other proper manuals instead.

$ sudo apt update


anhtuank7c / AesUtil.ts
Created March 17, 2024 03:11 — forked from btxtiger/AesUtil.ts
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
* Cryptography Functions
* Forked from AndiDittrich/AesUtil.js
import crypto, { CipherGCM, CipherGCMTypes, DecipherGCM } from 'crypto';
import { Password } from './types';
anhtuank7c /
Created January 21, 2024 09:03 — forked from wojteklu/
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

anhtuank7c /
Last active January 17, 2024 03:08
Loại bỏ giọng nói trong video
anhtuank7c / cloudflare_workflow.yaml
Created January 7, 2024 07:18
Github workflow for deploying Sveltekit app to Cloudflare Pages
# Deploy to Cloudflare Workers/Pages with Wrangler
name: Deploy Pages
- main
anhtuank7c / useToggleStorybook.ts
Created October 19, 2023 09:44 — forked from MarceloPrado/useToggleStorybook.ts
Dynamically toggle between storybook and app
import { config } from "@/app/config";
import { createLogger } from "@/app/observability";
import { useEffect } from "react";
const { appEnv } = config;
const logger = createLogger("developer/storybook");
export const useToggleStorybook = () => {
const [isStorybookEnabled, setIsStorybookEnabled] = useState(false)
anhtuank7c / .gitignore
Created June 21, 2023 09:24 — forked from tatsuyasusukida/.gitignore
Node.js Docker Image that can uses FFmpeg
import { TranslateOptions } from 'i18n-js/typings'
import {StyleProp, Text as RNText, TextProps as RNTextProps, TextStyle} from 'react-native'
import { TxKeyPath, useI18n } from '../hooks/useI18n'
import { ThemeProps, useThemeColor } from './Themed'
const presets = {
default: {fontSize: 17, lineHeight: 24, fontWeight: 'normal'} as StyleProp<TextStyle>,
primary: {fontSize: 17, lineHeight: 24, fontWeight: '600'} as StyleProp<TextStyle>,
secondary: {fontSize: 17, lineHeight: 24, fontWeight: 'normal'} as StyleProp<TextStyle>,
header: {fontSize: 27, lineHeight: 34, fontWeight: '600' } as StyleProp<TextStyle>,
anhtuank7c /
Created January 7, 2023 10:41
[Mac/Linux] List and remove all the node_modules at the current directory
# Cleanup node_modules
echo "Calculate disk space for node_modules in all directory"
find . -name "node_modules" -type d -prune -print | xargs du -chs
echo "Remove all node_modules directory"
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
anhtuank7c / const_keyword.dart
Last active June 23, 2022 07:15
Exploring const keyword in Dart
class Contact {
// Constructor is marked 'const' so all fields must be final.
final String name;
final int age;
// const at class level have to go along with static keyword
static const alive = true;
// const constructor
const Contact(, this.age);