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 / file_checker.cpp
Created December 1, 2024 18:55
Advanced File Type Detection Program like GNU file type detection tool
// Advanced File Type Detection Program like GNU file type detection tool
// Note: This program is a simplified version and may not cover all possible file types.
// Created by: HeavenHM.
// Date: 2024-01-12
#include <iostream>
#include <fstream>
#include <string>
#include <filesystem>
#include <algorithm>
@thomwolf
thomwolf / fast_speech_text_speech.py
Last active January 14, 2025 12:13
speech to text to speech
""" To use: install LLM studio (or Ollama), clone OpenVoice, run this script in the OpenVoice directory
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
pip install whisper pynput pyaudio
"""
from openai import OpenAI
import time
@haseeb-heaven
haseeb-heaven / CodeRunner.sh
Last active January 4, 2024 00:05
A universal script for compiling and running various programming languages. It supports C, C++, Java, Go, C#, Python, JavaScript, Swift, Scala, Ruby, and Kotlin, identifying the language by file extension and using the appropriate compiler or interpreter, usage: ./CodeRunner.sh program.cpp
#!/bin/bash
# Get the filename from the command line argument
filename=$1
debug=0
cpp_version="c++17"
# Determine the file extension, compiler, and language based on the filename
if [[ $filename == *.c ]]; then
extension=".c"
@haseeb-heaven
haseeb-heaven / MemorySizeDetector.c
Last active December 11, 2023 23:04
Cross-Platform Memory Size Detector in C portable way.
/*
Description: Cross-Platform Memory Size Detector in C
Author: HeavenHM
Language: C
Date: 12-12-2023
Compilers Tested: GCC, Clang, MSVC.
Platforms Tested: Unix,Linux, MacOS, Windows.
*/
// Includes for cross-platform compatibility.
@haseeb-heaven
haseeb-heaven / README.md
Last active January 7, 2025 11:47
Turn your keyboard to Piano using Python.

PyPiano

This Python program uses several libraries to generate and play sine wave tones based on keyboard input.

Libraries Used

  • io: This is a built-in Python library for handling streams of data. It's included with Python, so you don't need to install it separately.

  • pydub: This is a simple and easy-to-use library to manipulate audio files. It can be installed with pip using pip install pydub. It's used in this code to generate a sine wave tone and play it.

@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 / 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 / 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 / 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) {
/**
* @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.*/