Skip to content

Instantly share code, notes, and snippets.

View anhtuank7c's full-sized avatar

Tuan Nguyen anhtuank7c

View GitHub Profile
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
View cloudflare_workflow.yaml
# 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
View useToggleStorybook.ts
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
View Text.tsx
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
View const_keyword.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);
anhtuank7c / final_keyword.dart
Last active June 18, 2022 15:02
Exploring final keyword in Dart
View final_keyword.dart
class Contact {
String name;
int age;
Contact(, this.age);
String toString() {
return "$name: $age";
anhtuank7c / AudioCue.kt
Created April 20, 2022 02:53
AudioCue class, let initial this class to call speakOut function to speech the text.
View AudioCue.kt
package com.example;
import android.content.Context
import android.content.Context.AUDIO_SERVICE
import android.os.Build
import android.os.Bundle
import android.speech.tts.TextToSpeech