Skip to content

Instantly share code, notes, and snippets.

View protectroot-com's full-sized avatar

ProtectRoot.com protectroot-com

View GitHub Profile
@protectroot-com
protectroot-com / Csharp-net-core-5-DOH-query.cs
Last active March 6, 2021 19:08
C# .net core 5.0 DOH query
using System;
using Makaretu.Dns;
// add the Makaretu.Dns.Unicast Nuget package.
namespace testing123
{
class Program
{
static void Main(string[] args)
{
//add the Makaretu.Dns.Unicast Nuget package.
@protectroot-com
protectroot-com / listAllFilesOnNonOSDriveFast.cs.
Created March 7, 2021 02:18
ListAllFilesOnNonOSDriveFast
using System;
using System.IO;
using System.Collections.Generic;
//source..https://stackoverflow.com/questions/1393178/unauthorizedaccessexception-cannot-resolve-directory-getfiles-failure
namespace whatever
{
class Program
{
static void Main(string[] args)
{
@protectroot-com
protectroot-com / backtracking_template.py
Created February 19, 2022 16:54 — forked from RuolinZheng08/backtracking_template.py
[Algo] Backtracking Template & N-Queens Solution
def is_valid_state(state):
# check if it is a valid solution
return True
def get_candidates(state):
return []
def search(state, solutions):
if is_valid_state(state):
solutions.append(state.copy())
@protectroot-com
protectroot-com / foo1.txt
Last active January 25, 2023 02:36
strip out numbers. Just display the letters.
awk '{gsub(/[^a-zA-Z]/,"")}1'
keep spaces
cat file.txt | awk '{gsub(/[^a-zA-Z ]/,"")}1'
keep spaces and dots
cat file.txt | awk '{gsub(/[^a-zA-Z .]/,"")}1'
<!DOCTYPE html>
<html>
<head>
<title>Button with Gear Icon</title>
<style>
/* Style for the gear icon */
.gear-icon {
display: inline-block;
width: 16px;
height: 16px;