Skip to content

Instantly share code, notes, and snippets.

View vixhentx's full-sized avatar

Trihydra vixhentx

View GitHub Profile
@vinsonzou
vinsonzou / gitea_sso_feishu.lua
Last active December 4, 2025 03:27
Gitea通过飞书开放平台实现SSO
--[[
通过飞书登录获取用户email字段(用户飞书中必须添加email属性,否则无法登录!!!),如email地址为test@example.com,则gitea用户为test
登录后设定cookie,cookie有效期10小时
飞书开放平台的企业自建应用设置:
1、配置 安全设置-重定向URL,如此示例中的https://git.example.com
2、权限:获取用户邮箱信息
自动注册后,需管理员调整如下信息:
1、自定义名称
@TaoK
TaoK / TextFileEncodingDetector.cs
Last active September 10, 2025 12:40
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
{
/*