Skip to content

Instantly share code, notes, and snippets.

@Laiteux
Laiteux / ValidateTelegramUsername.cs
Last active May 12, 2024 08:52
C# method to validate a Telegram username using RegEx
using System;
using System.Text.RegularExpressions;
// NOTE: Change min length to 4 (instead of 5) in the RegEx if you want to include/allow NFT/Fragment usernames
bool ValidateTelegramUsername(string username)
=> Regex.IsMatch(username.TrimStart('@'),
@"^(?=.{5,32}$)(?!.*__)(?!^(telegram|admin|support))[a-z][a-z0-9_]*[a-z0-9]$",
RegexOptions.IgnoreCase | RegexOptions.Compiled);
Console.WriteLine(ValidateTelegramUsername("Laiteux1")); // True
@Laiteux
Laiteux / CloudflareDnsCleaner.cs
Last active May 12, 2024 08:53
Ready-to-use C# script to delete all DNS records from a Cloudflare domain
using System;
using System.Linq;
using System.Net.Http;
using System.Text.Json;
using System.Threading.Tasks;
namespace CloudflareDnsCleaner
{
// NOTE: Old, idk if it still works or anything
public static class Program

Keybase proof

I hereby claim:

  • I am Laiteux on github.
  • I am laiteux (https://keybase.io/laiteux) on keybase.
  • I have a public key whose fingerprint is 46C0 9546 A24F 4C3F 52DC D813 2140 1EA7 66E3 C84D

To claim this, I am signing this object: