Skip to content

Instantly share code, notes, and snippets.

View nguyenmanh1507's full-sized avatar

Ng Manh nguyenmanh1507

View GitHub Profile
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
@nguyenmanh1507
nguyenmanh1507 / Accordion.tsx
Created April 26, 2023 11:30
Simple accessibility React Accordion
import {
ButtonHTMLAttributes,
DetailedHTMLProps,
Dispatch,
HTMLAttributes,
SetStateAction,
createContext,
useContext,
useId,
useState,
@nguyenmanh1507
nguyenmanh1507 / conventional-commits.md
Last active January 31, 2023 04:31 — forked from Zekfad/conventional-commits.md
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@nguyenmanh1507
nguyenmanh1507 / clean_code.md
Created November 4, 2021 17:01 — 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

@nguyenmanh1507
nguyenmanh1507 / machine.js
Last active November 4, 2019 08:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@nguyenmanh1507
nguyenmanh1507 / SketchSystems.spec
Created April 11, 2019 03:17
Effortless English App
Effortless English App
Login Screen
Login -> Second State
Second State
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Draggable : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler {
public void OnBeginDrag (PointerEventData eventData) {
Debug.Log("OnBeginDrag");
Input.multiTouchEnabled = false;
@nguyenmanh1507
nguyenmanh1507 / validate.js
Created January 22, 2018 07:56
yola-nps-basic-validate
;(function() {
'use strict'
// Disabling form submissions if there are invalid fields
window.addEventListener(
'load',
function() {
// Fetch all the forms we want to apply custom Bootstrap validation styles to
var forms = document.getElementsByClassName('needs-validation')
<body class="bg-light">
<!--[if IE]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div class="container">
<div class="py-5 text-center">
<img class="d-block mx-auto mb-4" src="https://getbootstrap.com/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72">
<h2>Checkout form</h2>
<p class="lead">Below is an example form built entirely with Bootstrap's form controls. Each required form group has a validation state