Skip to content

Instantly share code, notes, and snippets.

View shajeen's full-sized avatar

Ahamed shajeen

View GitHub Profile
@shajeen
shajeen / compress.sh
Created September 26, 2024 10:30
compress folder to 7z
#!/bin/bash
# List all directories in the current folder
for dir in */; do
# Remove trailing slash from directory name
dirname=${dir%/}
# Compress the directory using 7zip with maximum compression
7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on "${dirname}.7z" "$dir"
@shajeen
shajeen / [cpp] sorting algorithm
Created August 2, 2019 17:52
c++11 standard sorting algorithm implementation
// sort.cpp : Defines the entry point for the console application.
//
#include <array>
#include <random>
#include <iostream>
#include <functional>
#include <chrono>
#include <string>
@shajeen
shajeen / [Qt] access remote mysql database
Created August 2, 2019 17:43
access remote mysql db using qt framework
#include <QCoreApplication>
#include <QSqlDatabase>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL3");
db.setHostName("db4free.net");
@shajeen
shajeen / [cpp] poco memory management
Created August 2, 2019 17:41
Poco library memory management
// memoryManagement.cpp : Defines the entry point for the console application.
//
#include <string>
#include <iostream>
#include <Poco\AutoPtr.h>
#include <Poco\RefCountedObject.h>
#include <Poco\AutoReleasePool.h>
#include <Poco\SharedPtr.h>
@shajeen
shajeen / [cpp] c++11 concepts
Last active August 2, 2019 17:39
c++11 concepts
// cpp11.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <memory>
#include <array>
#include <vector>
#include <string>
#include <algorithm>
@shajeen
shajeen / [python] clone all star repo
Last active November 9, 2024 06:10
Code to download all stared repo
from github import Github
from pygit2 import clone_repository
import random
import string
import json
import os
path = "/home/shajeen/Documents/git_stared/"
g = Github("git personal access token")