Skip to content

Instantly share code, notes, and snippets.

@ChauThan
ChauThan / regex-japanese.txt
Created January 3, 2018 06:33 — forked from terrancesnyder/regex-japanese.txt
Regex for Japanese
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 (、。’)
@ChauThan
ChauThan / ContentReference
Created February 8, 2018 08:40 — forked from javafun/ContentReference
EPiServer - ContentReference Extensions
using System;
using System.Collections.Generic;
using EPiServer;
using EPiServer.Core;
using EPiServer.ServiceLocation;
using EPiServer7App.EPiServerCore.ContentTypes.Media;
using EPiServer7App.EPiServerCore.ContentTypes.Pages;
using EPiServer.Framework;
using System.IO;
using EPiServer7App.EPiServerCore.Model;
@ChauThan
ChauThan / Index.cs
Created June 19, 2018 07:12
[Humanized Date] #CSharp #DateTime #Format
internal static string HumanisedDate(this DateTime date)
{
string ordinal;
switch (date.Day)
{
case 1:
case 21:
case 31:
ordinal = "st";
@ChauThan
ChauThan / clean_code.md
Created October 17, 2023 03:07 — 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

@ChauThan
ChauThan / exe.sql
Last active March 22, 2024 14:51
[RecreateDatabase] #sqlserver #sql
EXEC sp_RecreateDatabase @DatabaseName = N'YourDatabase'; -- Thay 'YourDatabase' bằng tên cơ sở dữ liệu của bạn