Skip to content

Instantly share code, notes, and snippets.

View doggy8088's full-sized avatar
🙂
Giving is a reward in itself

Will 保哥 doggy8088

🙂
Giving is a reward in itself
View GitHub Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
public class DateOnlyConverter : JsonConverter<DateOnly>
{
private readonly string serializationFormat;
public DateOnlyConverter() : this(null) { }
public DateOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "yyyy-MM-dd";
}
public class TimeOnlyConverter : JsonConverter<TimeOnly>
{
private readonly string serializationFormat;
public TimeOnlyConverter() : this(null) { }
public TimeOnlyConverter(string? serializationFormat)
{
this.serializationFormat = serializationFormat ?? "HH:mm:ss.fff";
}
  1. 開啟 Windows PowerShell

  2. IE 函式加入到 $PROFILE 之中

    [System.IO.Directory]::CreateDirectory([System.IO.Path]::GetDirectoryName($PROFILE))
    notepad $PROFILE
@doggy8088
doggy8088 / 170902_Git_AMA_README.md
Created September 2, 2017 11:57
2017/9/2 FB 直播:Git 新手上路 AMA 實作練習腳本
@doggy8088
doggy8088 / TC_to_SC_DIFF.md
Last active April 19, 2023 04:15
正體字與簡體字差異字元比較
編號 繁體字 Unicode JavaScript 簡體字 Unicode JavaScript
1 U+5167 \u{5167} U+5185 \u{5185}
2 U+52FB \u{52FB} U+5300 \u{5300}
3 U+5F14 \u{5F14} U+540A \u{540A}
4 U+6236 \u{6236} U+6237 \u{6237}
5 U+518A \u{518A} U+518C \u{518C}
6 U+672E \u{672E} U+672F \u{672F}
7 U+6C3E \u{6C3E} U+6CDB \u{6CDB}
8 U+4E1F \u{4E1F} U+4E22 \u{4E22}
@doggy8088
doggy8088 / Global.asax.cs
Last active June 2, 2023 00:45
ReferenceLoopHandling for ASP.NET Web API
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
namespace WebApiSample
@doggy8088
doggy8088 / en-zh-bookmarklet.user.js
Created October 3, 2021 06:48
中、英文網頁切換的瀏覽器書籤小工具 (Tampermonkey Userscript)
// ==UserScript==
// @name 中、英文網頁切換的瀏覽器書籤小工具
// @namespace https://blog.miniasp.com/
// @version 0.1
// @description 按下 Alt+s 就會自動將目前網頁切換至中文或英文版
// @license MIT
// @homepage https://blog.miniasp.com/
// @homepageURL https://blog.miniasp.com/
// @website https://www.facebook.com/will.fans
// @source https://github.com/miniasp/en-zh-bookmarklet
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
# 移除兩個不實用的 Cmdlet Aliases
If (Test-Path Alias:curl) {Remove-Item Alias:curl}
If (Test-Path Alias:wget) {Remove-Item Alias:wget}
# 快速開啟 c:\windows\system32\drivers\etc\hosts 檔案
function hosts { notepad c:\windows\system32\drivers\etc\hosts }
# 快速產生一組亂數密碼 (預設會產生 10 個字元的密碼)
function New-Password {
<#