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
View $PROFILE_PSReadLine.ps1
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
@doggy8088
doggy8088 / Angular 16 Dev Setup.md
Last active August 17, 2023 03:59
Angular 16 開發環境說明
View Angular 16 Dev Setup.md
@doggy8088
doggy8088 / en-zh-bookmarklet.user.js
Created October 3, 2021 06:48
中、英文網頁切換的瀏覽器書籤小工具 (Tampermonkey Userscript)
View en-zh-bookmarklet.user.js
// ==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
View DynamicJsonConverter.cs
public class DynamicJsonConverter : JsonConverter<dynamic>
{
public override dynamic Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.True)
{
return true;
}
@doggy8088
doggy8088 / Global.asax.cs
Last active June 2, 2023 00:45
ReferenceLoopHandling for ASP.NET Web API
View Global.asax.cs
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 / TC_to_SC_DIFF.md
Last active April 19, 2023 04:15
正體字與簡體字差異字元比較
View TC_to_SC_DIFF.md
編號 繁體字 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 / README.md
Last active April 9, 2023 12:40 — forked from Trenly/README.md
Install Winget to the Windows Sandbox Base Image
View README.md

This powershell script modifies the Base Image, or the Virtual Hard Disk, which the Windows Sandbox launches upon startup. It will copy the required files to the sandbox and add a registry key which will install them upon startup. By default the script will install the latest stable release of Winget. You can specify to use the latest pre-release with the -PreRelease switch.

When a new version of Winget is released, run this script again to update the installation in the sandbox to the latest version

View $PROFILE_ArgumentCompleter.ps1
# winget parameter completion
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
$Local:word = $wordToComplete.Replace('"', '""')
$Local:ast = $commandAst.ToString().Replace('"', '""')
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
@doggy8088
doggy8088 / settings.json
Last active March 6, 2023 06:12
Will 保哥的 VSCode 使用者設定檔
View settings.json
{
"explorer.openEditors.visible": 0,
"workbench.colorTheme": "Default Light+",
"workbench.iconTheme": "vscode-simpler-icons",
"workbench.sideBar.location": "right",
// 需下載安裝 Fira Code 字型 (安裝 OTF 格式)
// https://github.com/tonsky/FiraCode/releases
// 需下載客製化過的 Microsoft YaHei Mono 字型
@doggy8088
doggy8088 / WSLConfig.md
Created July 28, 2020 07:17
WSL 2 的 .wslconfig 設定檔說明
View WSLConfig.md
  • 編輯 %UserProfile%\.wslconfig 檔案

    • Command Prompt

      notepad %UserProfile%\.wslconfig
    • Windows PowerShell