Skip to content

Instantly share code, notes, and snippets.

@abdoei
abdoei / README.md
Created August 2, 2023 05:05
Linux Mint 21.2 Hibernate mode setup

Hibernate it!

After reading so many blogs out there and nothing of them worked for me to hibernate Linux Mint 21.2, I randomly found a video on YouTube that worked for me. I'm sharing it here so that it can help others too and me in future if I forget it.

  1. First: this blog post is the one he followed in the video.
  2. The video - first part: 56 seconds long.
  3. The video - second part: 3 minutes and 45 seconds long.
  4. The video - third part: 38 seconds long.
  5. A link from the video description: StackExchange answer.

![image](https://user-images.githubusercontent.com/64744285/257706846-6f7f2290-8be0-

@abdoei
abdoei / eval_from_scratch.cpp
Created August 31, 2023 04:02
I have written a linked stack class and used it to implement a Python-like eval fuction to evaluate math expressions from scratch
#include <iostream>
#include <string>
#include <cmath>
using std::pow;
using namespace std;
/*********************************** Stack implementation ***********************************/
template <class T>
class Stack{
@abdoei
abdoei / queue.cpp
Created August 31, 2023 21:24
My implementation of the queue data structure
#include <iostream>
using namespace std;
template <class T>
class Queue
{
struct Node
{
@abdoei
abdoei / ayah_text_clear(1).csv
Last active December 12, 2023 23:21
Quran suras names, numbers and number of ayas
We can't make this file beautiful and searchable because it's too large.
sorah,ayah,text
1,1,بسم الله الرحمن الرحيم
1,2,الحمد لله رب العالمين
1,3,الرحمن الرحيم
1,4,مالك يوم الدين
1,5,إياك نعبد وإياك نستعين
1,6,اهدنا الصراط المستقيم
1,7,صراط الذين أنعمت عليهم غير المغضوب عليهم ولا الضالين
2,1,الم
2,2,ذلك الكتاب لا ريب فيه هدى للمتقين
@abdoei
abdoei / GR_AlTablaway.csv
Last active December 16, 2023 03:04
Generated, segmented and mapped
We can't make this file beautiful and searchable because it's too large.
sura,aya,start,end,duration,text,reference_text,diff,gen_seg_num,ref_seg_num
1,0,0.0,6.34,6.34, اعوذ بالله من الشيطان الرجيم,,-5,0,0
1,1,0.0,6.0,6.0, بسم الله الرحمن الرحيم,بسم الله الرحمن الرحيم,0,1,1
1,2,0.0,6.0,6.0, الحمد لله رب العالمين,الحمد لله رب العالمين,0,1,1
1,3,0.0,4.18,4.18, الرحمن الرحيم,الرحمن الرحيم,0,1,1
1,4,0.0,3.9,3.9, مالك يوم الدين,مالك يوم الدين,0,1,1
1,5,0.0,5.5,5.5, إياك نعبد وإياك نستعين,إياك نعبد وإياك نستعين,0,1,1
1,6,0.0,4.52,4.52, اهدنا الصراط المستقيم,اهدنا الصراط المستقيم,0,1,1
1,7,0.0,14.16,14.16, سراط الذين أنامت عليهم غير المغضوب عليهم ولا الضالين,صراط الذين أنعمت عليهم غير المغضوب عليهم ولا الضالين,0,1,1
2,0,0.0,6.12,6.12, بسم الله الرحمن الرحيم,,-4,0,0
@abdoei
abdoei / launch.json
Created May 5, 2024 01:11
Clang and GCC build(tasks) and debug(launch) files for my linux machine
{
"configurations": [
{
// Clang
"name": "C/C++: clang++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
@abdoei
abdoei / converter.cpp
Created October 3, 2024 23:49
UTF-8 to UTF-32 simple implementation
#include <iostream>
#include <iomanip> // For std::hex
#include <cstdint> // For uint32_t
void Read(const char8_t* ptr, char32_t &cp) {
char32_t u1, u2, u3, u4;
u1 = *ptr++;
if (u1 <= 0x7F) { // One byte code point