Skip to content

Instantly share code, notes, and snippets.

View haseeb-heaven's full-sized avatar
🏠
Working from home

HeavenHM haseeb-heaven

🏠
Working from home
View GitHub Profile
@haseeb-heaven
haseeb-heaven / FileSummary.cpp
Last active October 12, 2021 23:07
Prints file summary all printable, non-printable characters from any file , or strings extraction from any file just like GNU 'strings'. tool.
/*File summary - Prints file summary all printable, non-printable characters from any file.
Can also works as strings extraction from any file just like GNU 'strings'. tool.
By Artic Coder.
*/
#include <iostream>
#include <fstream>
#include <vector>
std::string ReadFile(std::string file_name);
@haseeb-heaven
haseeb-heaven / AsciiTextGenerator.c
Last active June 15, 2022 10:11
AsciiTextGenerator is text generator like FIGlet fonts.
/*Ascii text Generator in C. - Convert your text or any text to fancy ASCII font.
Artic Coder */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define TEXT_LEN 0x64
#define FONT_HEIGHT 5
#define FONT_WIDTH 53
/* AutoCloseMessageBox - C++ Implementation of original code of C# from CodeProject https://www.codeproject.com/Articles/7968/MessageBox-with-a-timeout-for-NET
By Artic Coder.
*/
#undef UNICODE
#include <iostream>
#include <Windows.h>
using std::string;
//Pointer to Hook functions.
/**
* @description - Read any ASCII,BINARY or HEX file.
* @param - Source file name and file type.
* @return - Returns data in tuple format,use std::get<TUPLE_ID>(TUPLE_OBJ) to get data.
*/
/*Including STD-C++ libraries*/
#include <iostream> /*For basic I/O.*/
#include <fstream> /*For basic I/O.*/
#include <sstream> /*For basic I/O.*/
#include <vector> /*For STL vector.*/
@haseeb-heaven
haseeb-heaven / CSharp-Utils.cs
Last active May 26, 2022 15:05
CSharp Utilities for UI,File Operations Handles,Web Connectsions and more.
//UI-Dialogs and MessageBox.
internal static void ShowWarning(string warnMsg, string caption = "WARNING") {
DialogMsgBox.ShowBox(caption, warnMsg, MsgBoxButtons.Ok);
}
internal static void ShowError(string errMsg, string caption = "ERROR") {
DialogMsgBox.ShowBox(caption, errMsg, MsgBoxButtons.Ok);
}
internal static void LogException(string methodName, Exception ex) {
@haseeb-heaven
haseeb-heaven / Pandas_Csv_Reader.py
Last active March 21, 2022 21:50
Read and iterate over CSV using Pandas in Python
#Info: Read Csv file from Pandas with header.
#Author: Haseeb Mir.
#Date: 03/22/2022
#%%
import string
import pandas as pd
def read_csv_list(csv_file:string):
df = pd.read_csv(csv_file,index_col=0) # Read Body data-frame.
@haseeb-heaven
haseeb-heaven / XMLParser.py
Created May 26, 2022 15:36
XML Parsers collection using Element Tree and BeautifulSoup.
"""
Info: XML Parser using Element Tree and BeautifulSoup.
Author: Haseeb Mir.
Date: 05/26/2022
"""
#Import the Package modules.
import xml.etree.ElementTree as xml
from bs4 import BeautifulSoup
@haseeb-heaven
haseeb-heaven / ResolveType.cpp
Created June 16, 2022 15:06
C++ Data type resolve in Compile-Time using T-Template and Runtime using TypeId.
/*
Info: C++ Data type resolve in Compile-Time using T-Template and RunTime using TypeId.
Author: Haseeb Mir @2022.
*/
#include <iostream>
#include <list>
#include <map>
#include <string>
#include <typeinfo>
#include <string_view>
@haseeb-heaven
haseeb-heaven / PrintContainer.cpp
Last active November 22, 2023 00:14
C++ General way of printing data of container including List,Sets,Maps,Stack,Queues etc.
/*
Info: C++ General way of printing data of container including List, Sets, Maps, Stack, Queues, etc.
Author: Haseeb Mir @2022.
*/
#include <iostream> // For input/output operations
#include <map> // For std::map
#include <stack> // For std::stack
#include <queue> // For std::queue
@haseeb-heaven
haseeb-heaven / NumberBaseValidator.c
Created March 3, 2023 23:10
This C program detects the base of an input number and validates it. The program examines the first few characters of the input string to detect the base (binary, octal, decimal, or hexadecimal) and validates the input number to ensure that it contains only valid digits for the detected base
#include <stdio.h>
#include <ctype.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
bool IsValidNumber(char *p_input, int base);
int DetectBase(char *p_input);
int main() {