Skip to content

Instantly share code, notes, and snippets.

View hoangphunam0604's full-sized avatar
🐢
slowly

Hoang Phu Nam hoangphunam0604

🐢
slowly
View GitHub Profile

Keybase proof

I hereby claim:

  • I am hoangphunam0604 on github.
  • I am hoangphunam (https://keybase.io/hoangphunam) on keybase.
  • I have a public key ASBgHHyqwxdfIS4DX2KgvX_n5-qx5u1usYyV47QAmQocgwo

To claim this, I am signing this object:

@hoangphunam0604
hoangphunam0604 / abstract-unique-validator.ts
Created January 5, 2021 02:36 — forked from zarv1k/abstract-unique-validator.ts
Unique Validator Example for NestJS
import { ValidationArguments, ValidatorConstraintInterface } from 'class-validator';
import { Connection, EntitySchema, FindConditions, ObjectType } from 'typeorm';
interface UniqueValidationArguments<E> extends ValidationArguments {
constraints: [
ObjectType<E> | EntitySchema<E> | string,
((validationArguments: ValidationArguments) => FindConditions<E>) | keyof E,
];
}
@hoangphunam0604
hoangphunam0604 / get_number_very_small_decimal_digits.php
Last active February 17, 2022 16:04
get number of very very small decimal digits
<?php
//get_number_very_small_decimal_digits(0.000000000097232321312312);
// return (string) 0.000000000097232321312312
//get_number_very_small_decimal_digits(0.000000098765);
// return (string) 0.000000098765
//get_number_very_small_decimal_digits(0.0000000000987);
// return (string) 0.0000000000987
@hoangphunam0604
hoangphunam0604 / JapaneseRegex.js
Created December 15, 2023 02:02 — forked from ryanmcgrath/JapaneseRegex.js
Regex to test for presence of Japanese characters
// REFERENCE UNICODE TABLES:
// http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
// http://www.tamasoft.co.jp/en/general-info/unicode.html
//
// TEST EDITOR:
// http://www.gethifi.com/tools/regex
//
// UNICODE RANGE : DESCRIPTION
//
// 3000-303F : punctuation