Skip to content

Instantly share code, notes, and snippets.

Avatar

Ayoub Malek SuperKogito

View GitHub Profile
View chmod-converter.js
var chmod_dict = {
"r": 4,
"w": 2,
"x": 1,
"rwx": "7",
"rw-": "6",
"r-x": "5",
"r--": "4",
"-wx": "3",
"-w-": "2",
View DivideImageUsingGdiplus.cpp
#include <Windows.h>
#include <minmax.h>
#include <gdiplus.h>
#include <SDKDDKVer.h>
#pragma comment(lib,"gdiplus.lib")
#include "atlimage.h"
bool saveToMemory(Gdiplus::Bitmap* tile, std::vector<BYTE>& data, std::string dataFormat)
{
View DivideImageUsingOpenCv.cpp
/***********************************************************************
* \file DivideImageUsingOpenCv.cpp
* \brief divide image into multiple blocks using OpenCV.
*
* \author SuperKogito
* \date October 2020
*
* @note:
* references and sources:
* - https://answers.opencv.org/question/53694/divide-an-image-into-lower-regions/
@SuperKogito
SuperKogito / CaptureSceenshotUsingGdiplusVSCaptureSceenshotUsingOpenCV.cpp
Last active Aug 1, 2020
A quick comparison between the speed of a screen capture using GDI+ (gdiplus) and another using OpenCV.
View CaptureSceenshotUsingGdiplusVSCaptureSceenshotUsingOpenCV.cpp
/***********************************************************************
* \file CaptureSceenshotUsingGdiplusVSCaptureSceenshotUsingOpenCV.cpp
* \brief capture screenshot using GDI+ and save it to drive or memory.
*
* \author SuperKogito
* \date July 2020
*
* @note:
* references and sources:
*
@SuperKogito
SuperKogito / CaptureMonitorsRects.cpp
Last active Jul 27, 2020
A small snippet displaying how to get the rectangles structures (coordinates) associated with all the connected screens/monitors.
View CaptureMonitorsRects.cpp
/*********************************************************************
* \file CaptureMonitorsRects.cpp
* \brief capture monitors rectangles handles in a custom structure.
*
* \author SuperKogito
* \date July 2020
*
* @note:
* references and sources:
*
@SuperKogito
SuperKogito / CaptureScreenUsingGdiplus.cpp
Last active Jul 27, 2020
Code for my blog post <https://superkogito.github.io/blog/CaptureScreenUsingGdiplus.html> A snippet for capturing the screen content using GDI+ (gdiplus)
View CaptureScreenUsingGdiplus.cpp
/*******************************************************************************************
* \file CaptureSceenshotUsingGdiplus.cpp
* \brief capture screenshot using GDI+ and save it to drive or memory.
*
* \author SuperKogito
* \date July 2020
*
* @note:
* references and sources:
* - https://docs.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-gdi-start
@SuperKogito
SuperKogito / CaptureSceenshotUsingOpenCV.cpp
Last active Jul 27, 2020
Code for my blog post <https://superkogito.github.io/blog/CaptureScreenUsingOpenCv.html> A snippet for capturing the screen content using OpenCV
View CaptureSceenshotUsingOpenCV.cpp
/*****************************************************************************************************************
* \file CaptureSceenshotUsingOpenCV.cpp
* \brief capture screenshot using OpenCV and save it as a png.
*
* \author SuperKogito
* \date July 2020
*
* @note:
* references and sources:
* - http://msdn.microsoft.com/en-us/library/windows/window/dd183402%28v=vs.85%29.aspx
View K-nearest-neighbor.py
import warnings
import numpy as np
import pandas as pd
import seaborn as sns
from pylab import rcParams
import matplotlib.pyplot as plt
from sklearn import preprocessing
from sklearn import neighbors, datasets
from matplotlib.colors import ListedColormap
from sklearn.neighbors import KNeighborsClassifier
@SuperKogito
SuperKogito / ffmpeg.md
Created Oct 1, 2018 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files
View ffmpeg.md

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz: