Skip to content

Instantly share code, notes, and snippets.

@AptiviCEO
AptiviCEO / ExpressionGetSet.cs
Last active December 25, 2022 14:55
Fields and properties get and set functions using expression
using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Linq.Expressions;
namespace Aptivi;
class ExpressionGetSet
@AptiviCEO
AptiviCEO / VTFilter.py
Created August 5, 2022 09:48
Filter and find VT sequences in string
import re
import argparse
def filterVTSequences(text):
pattern = '^(\x9D|\x1B\]).+(\x07|\x9c)|\x1b [F-Nf-n]|\x1b#[3-8]|\x1b%[@Gg]|\x1b[()*+][A-Za-z0-9=`<>]|\x1b[()*+]\"[>4?]|\x1b[()*+]%[0-6=]|\x1b[()*+]&[4-5]|\x1b[-.\/][ABFHLM]|\x1b[6-9Fcl-o=>\|\}~]|(\x9f|\x1b_).+\x9c|(\x90|\x1bP).+\x9c|(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]|(\x9e|\x1b\^).+\x9c|\x1b[DEHMNOVWXYZ78]$'
result = re.sub(pattern, '', text)
print(result)
parser = argparse.ArgumentParser()
parser.add_argument('text', type=str, help="Text to filter")
@AptiviCEO
AptiviCEO / NameGen.py
Created July 29, 2022 12:23
Name generator in Python using our NamesList database
# Necessary imports for this app
from urllib.request import urlopen
import argparse
import random
# Functions
def genname(num):
# Get first names
firstNames = urlopen('https://cdn.jsdelivr.net/gh/EoflaOE/NamesList@master/Processed/FirstNames.txt').read()
firstNamesArray = firstNames.decode('utf-8').splitlines()