Skip to content

Instantly share code, notes, and snippets.

View zhaopan's full-sized avatar
:octocat:

ZP zhaopan

:octocat:
  • CQ·CHINA
  • 19:31 (UTC +08:00)
View GitHub Profile
@zhaopan
zhaopan / 01.SysTaskQueueProducer.cs
Last active December 3, 2025 14:40
SysTaskQueueProducer
using FreeSql;
using Mapster;
using System.Collections.Concurrent;
using Yitter.IdGenerator;
using ZhonTai.Admin.Core.Configs;
using ZhonTai.Admin.Domain.MP;
using ZhonTai.Admin.Services.Dtos;
using ZhonTai.Admin.Services.MP;
namespace ZhonTai.Admin.Core
@zhaopan
zhaopan / TreeList.cs
Created December 3, 2025 14:18
DFS&BFS
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp
{
/// <summary>
/// 表示树形结构中的一个节点。
/// </summary>
public class Nodes
# git 重命名文件夹/文件
git mv -f <oldfolder> <newfolder>

# eg: 现有文件夹:test,需修改为:test_file
git mv -f test test_file
git add -u test_file    # -u:会更新已经追踪的文件和文件夹
git commit -m "重命名文件夹"
git push origin master
# 设置主机名称 (centos7+支持)
# centos6修改主机名的配置文件是 /etc/sysconfig/network
# centos7修改主机名的配置文件是 /etc/hostname
$hostnamectl set-hostname <your hostname>
--static # 注:该命令会同步修改 /etc/hostname
--pretty # 给主机起别名(昵称)
# eg: 设置为 ts01
$hostnamectl set-hostname "ts01" --static
@zhaopan
zhaopan / EnumPower.cs
Last active April 5, 2025 00:00
EnumPower
using System;
using System.Collections;
using System.Text;
namespace Common.Lib
{
/// <summary>
/// 角色权限对象,拥有指定权限。(可支持64个独立的权限项)
/// </summary>
/// <typeparam name="T">泛型 T (权限列表)必须是一个枚举。</typeparam>
@zhaopan
zhaopan / UnitTest.cs
Last active December 3, 2025 14:23
UnitTest
using System;
using System.IO;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace MyTests
{
[TestClass]
public class UnitTest1
{
private const string LogFileName = "TestOutputLog.txt";
@zhaopan
zhaopan / ListComparer.cs
Last active December 3, 2025 14:06
ListComparer
using System;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// 物料代码实体。
/// </summary>
public class EntMaterielCodes
{
public string? RFIDCode { get; set; }
@zhaopan
zhaopan / List-Union-Intersect-Except.cs
Last active December 3, 2025 14:25
List-Union-Intersect-Except
并集:var union =arps.Union(flts).ToList();
交集:var inters = arps.Intersect(flts).ToList();
差集:var except= arps.Except(flts).ToList();