Skip to content

Instantly share code, notes, and snippets.

View Jun1sMe's full-sized avatar

Jun Jun1sMe

  • Taipei, Taiwan
View GitHub Profile
@Jun1sMe
Jun1sMe / RegEx CaptureNameOrTel.cs
Created January 22, 2022 07:57 — forked from relyky/AddressParser.cs
RegEx實戰紀錄;字串解析:String.IndexOf, RegEx, Match, Regular Expression
/// <summary>
/// 再解析出:電話/非電話(即人名);
/// </summary>
public static IEnumerable<NameOrTel> CaptureNameOrTel(string loi_clause)
{
// 電話號碼 pattern
string ptnTel = @"(\([HOM]\))?[0-9()+]+[0-9\-()*~# ]*[0-9]+(\-[HOM]|\([HOM]\)|\(主要\))?";
// 人名 pattern := 中文名稱與難字 | 英文名稱
string ptnName = @"((\p{IsCJKUnifiedIdeographs}|[\ue000-\ue3ff])+([a-zA-z\s]+[a-zA-z\s-]*)?|[a-zA-z]+[a-zA-z\s-]*)";
// 人名或電話 pattern
@Jun1sMe
Jun1sMe / PinToSafeArea.cs
Created November 24, 2021 03:39 — forked from SeanMcTex/PinToSafeArea.cs
Restrict Unity UI to an iPhone X or other Mobile Device's Safe Area
using UnityEngine;
/// <summary>
/// Resizes a UI element with a RectTransform to respect the safe areas of the current device.
/// This is particularly useful on an iPhone X, where we have to avoid the notch and the screen
/// corners.
///
/// The easiest way to use it is to create a root Canvas object, attach this script to a game object called "SafeAreaContainer"
/// that is the child of the root canvas, and then layout the UI elements within the SafeAreaContainer, which
/// will adjust size appropriately for the current device./// </summary>
@Jun1sMe
Jun1sMe / hugo-auto-deoply.yml
Created November 24, 2021 01:47 — forked from lisez/hugo-auto-deoply.yml
如何使用 Github Actions 自動部署 Hugo
# link: https://sujingjhong.com/posts/how-to-deploy-hugo-automatically-with-github-actions/
# author: lisez <[email protected]>
name: Auto publish to public site
# 只有推送到 master 才自動化
on:
push:
branches:
- master
@Jun1sMe
Jun1sMe / Markdown Cheatsheet 中文版.md
Created November 18, 2021 02:32 — forked from billy3321/Markdown Cheatsheet 中文版.md
Markdown Cheatsheet 中文版