This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 與 webpack.config.lazy.js 搭配,以進行動態拆分。 | |
import React, { lazy, Suspense, LazyExoticComponent, useMemo } from "react" | |
type ComponentType = LazyExoticComponent<React.ComponentType<any>>; | |
//## 所有作業都需先“註冊” | |
const funcPool = new Map<string, ComponentType>(); | |
funcPool.set("HomeIndex", lazy(() => import(/* webpackChunkName: "HomeIndex" */'./Home/HomeIndex'))); | |
funcPool.set("DEMO001", lazy(() => import(/* webpackChunkName: "DEMO001" */'./Demo/DEMO001/AppForm'))); | |
funcPool.set("DEMO002", lazy(() => import(/* webpackChunkName: "DEMO002" */'./Demo/DEMO002/AppForm'))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
連線 on Linux | |
redis-cli ## 預設 localhost:6379 | |
redis-cli -h <hostname> -p <port:6379> | |
連線 on windows | |
memurai-cli ## 預設 localhost:6379 | |
memurai-cli -h <hostname> -p <port:6379> | |
> PING ## PONG | |
> SET key value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async void Form1_Load(object sender, EventArgs e) | |
{ | |
// init | |
cboStatus.SelectedIndex = 0; | |
// init WebView2 → webAgent | |
await webAgent.EnsureCoreWebView2Async(null); | |
webAgent.CoreWebView2.Navigate("https://www.itfseafarers.org/en/abandonment-list/seafarer-abandonment"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@functions { | |
public static string MakeFake64(string b64) | |
{ | |
var f64 = new System.Text.StringBuilder(); | |
var vistor = b64.GetEnumerator(); | |
while (vistor.MoveNext()) | |
{ | |
switch (vistor.Current) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by EIJI on 2014/1/3. | |
* 民國年日期選擇器 https://codepen.io/not0000/pen/KvvGjr | |
* 更多資訊可參考原作者文章 http://softmenlouis.blogspot.com/2017/04/blog-post_74.html | |
*/ | |
(function(){ | |
var yearTextSelector = '.ui-datepicker-year'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 檢查版本 | |
python --version # python 版本 | |
python -m pip --version # pip 版本 | |
python -m django --version # django 版本 | |
django-admin --version # django-admin 版本 | |
## 用 django 建立第一個網站 | |
django-admin startproject mysite # 建立 Django website 並指定名稱為 mysite。 | |
cd mysite | |
python manage.py runserver # 啟動 Django website。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// ref→[Converting Action method call to async Action method call](https://stackoverflow.com/questions/33941583/converting-action-method-call-to-async-action-method-call) | |
/// 把同步的 Action 叫用轉換成非同步的 Action 叫用。 | |
/// Action ==> async Action | |
Execute(()=> { do_some_thing }); | |
轉換成:即 Action ==> 非同步化 ==> Task<Func> | |
ExecuteAsync(async ()=> { do_some_thing_async }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Utils | |
{ | |
/// <summary> | |
/// 仿 React 的 clsx 函式。 | |
/// 註:基於 C#10 語法限制只能有限實作部份能力。 | |
/// </summary> | |
/// <param name="cssClassList">支援 string | ValueTuple(string,bool)</param> | |
/// <example> | |
/// string cssClsx1 = Utils.Clsx("d-flex pa-6", ("visible", f_show), ("hidden", !f_show)); | |
/// string cssClsx2 = Utils.Clsx("d-flex pa-6", f_show ? "visible" : "hidden"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
§§ 使用 Jenkins 實作 CD 到 IIS 和 Docker。 | |
[Jenkins]Reverse proxy - IIS | |
https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-iis/ | |
[Jenkins]持續整合之路(一)Jenkins Master Server安裝 | |
https://dotblogs.com.tw/stanley14/2018/05/27/Jenkins_install | |
[Jenkins]持續整合之路(二)準備編譯.NET程式的環境(安裝MSBuild及NuGet Plugin) | |
https://dotblogs.com.tw/stanley14/2018/05/27/install_msbuild_nuget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Docker on ubuntu 手札 | |
## docker 指令 | |
檢查版本 | |
$ sudo docker --version | |
$ docker version | |
## 工作管理員 GUI | |
$ gnome-system-monitor 系統監控 |
NewerOlder