This file contains hidden or 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
public static void CheckSslCertificate(string url) | |
{ | |
try | |
{ | |
// 建立 HttpClientHandler 並攔截憑證驗證 | |
using var handler = new HttpClientHandler(); | |
handler.ServerCertificateCustomValidationCallback = (request, cert, chain, errors) => | |
{ | |
var x509 = new X509Certificate2(cert); |
This file contains hidden or 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
/* github 行號框限拿掉 */ | |
.article__content pre, .article__content table, .article__content td, .article__content th { | |
border: transparent 1px solid; | |
} | |
.gist .gist-file { | |
.gist-data { | |
background-color: #f7f7f7; |
This file contains hidden or 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
/// <summary> | |
/// 遮罩名字 | |
/// </summary> | |
/// <param name="name">原始姓名</param> | |
/// <param name="keepStart">保留開頭幾個字</param> | |
/// <param name="keepEnd">保留結尾幾個字</param> | |
/// <returns>遮罩後的姓名</returns> | |
public static string MaskName(string name, int keepStart = 1, int keepEnd = 1) | |
{ |
This file contains hidden or 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
/** | |
* 取得目前作用中的工作表名稱 | |
* | |
* 使用方式: | |
* 在 Google Sheets 的儲存格中輸入公式 =GetCurrentSheetName() | |
* 就會顯示當前工作表的名稱。 | |
* 此為 Chatgpt輔助生成的註解 | |
*/ |
This file contains hidden or 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
window.addEventListener('pageshow', function (event) { | |
HoldOn.close(); | |
}); | |
This file contains hidden or 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 static Task _TelegramBotClient_OnMessage(Telegram.Bot.Types.Message message, Telegram.Bot.Types.Enums.UpdateType type) | |
{ | |
if (message.Text==null) | |
{ | |
return Task.FromResult<object>(null); | |
} | |
if (message.Text.ToLower().StartsWith("/")) | |
{ |
This file contains hidden or 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 static Task _TelegramBotClient_OnUpdate(Telegram.Bot.Types.Update update) | |
{ | |
if (update.CallbackQuery != null) | |
{ | |
Console.WriteLine(update.CallbackQuery.From.Id + ":" + update.CallbackQuery.Data); | |
var sentMessage = _TelegramBotClient.SendMessage( |
This file contains hidden or 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
static TelegramBotClient _TelegramBotClient; | |
static CancellationTokenSource cts = new CancellationTokenSource(); | |
public static void InitTelegramBotClient() | |
{ | |
_TelegramBotClient = new TelegramBotClient("1234567890:AAD98dMandhVhEW4jDEu-LTm6fX9MYL9PKU4",httpClient:default,cts.Token); | |
_TelegramBotClient.OnMessage += _TelegramBotClient_OnMessage; | |
} |
This file contains hidden or 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
static TelegramBotClient _TelegramBotClient; | |
static CancellationTokenSource cts = new CancellationTokenSource(); | |
public static void InitTelegramBotClient() | |
{ | |
_TelegramBotClient = new TelegramBotClient("1234567890:AAD98dMandhVhEW4jDEu-LTm6fX9MYL9PKU4",httpClient:default,cts.Token); | |
_TelegramBotClient.OnMessage += _TelegramBotClient_OnMessage; |
This file contains hidden or 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
var filePath = AppDomain.CurrentDomain.BaseDirectory + "oooo.jpg"; | |
UploadImageToIPFS(filePath); | |
static void UploadImageToIPFS(string filePath) | |
{ | |
var client = new RestClient("https://app.img2ipfs.org/api/v0/add"); |
NewerOlder