Skip to content

Instantly share code, notes, and snippets.

View WeihanLi's full-sized avatar
🐞

Weihan Li WeihanLi

🐞
View GitHub Profile
Registration Code
Name : www.xyraclius.com
Serial : OOCRYIMDMDPWRETFPSUZ
@WeihanLi
WeihanLi / print-date.cs
Last active March 2, 2024 20:23
dotnet-exec test script
Console.WriteLine($"Current date: {DateTime.Now.Date: yyyy-MM-dd}");
@WeihanLi
WeihanLi / dotnet-format-action.yml
Created December 10, 2021 00:27 — forked from rickyah/dotnet-format-action.yml
Runs dotnet-format on every PR and create a commit that fixes the formatting if it doesn't comply with your code convention
name: Format check on pull request
on: pull_request
jobs:
dotnet-format:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2.2.0
with:
fetch-depth: 0
@WeihanLi
WeihanLi / TextFileEncodingDetector.cs
Created March 6, 2019 08:03 — forked from TaoK/TextFileEncodingDetector.cs
Simple class to automatically detect text file encoding, with English-biased "best guess" heuristic based on byte patterns in the absence of BOM.
using System;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
namespace KlerksSoft
{
public static class TextFileEncodingDetector
{
/*
@WeihanLi
WeihanLi / log4net.config
Created December 19, 2017 06:58
log4net configuration
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file type="log4net.Util.PatternString" value="./Log/systemLog.%date{yyyy-MM-dd}.log" />
<appendToFile value="true" />
<encoding value="unicodeFFFE" />