Skip to content

Instantly share code, notes, and snippets.

View dogukanarat's full-sized avatar
🎲
Programming

Doğukan Arat dogukanarat

🎲
Programming
View GitHub Profile
@dogukanarat
dogukanarat / FindSOIL.cmake
Created May 18, 2024 11:08
FindSOIL cmake module
# FindSOIL - Find FindSSOILOIL library
# This module finds if SOIL is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# SOIL_FOUND, if false, do not try to link to SOIL
# SOIL_INCLUDE_DIRS, where to find SOIL.h
# SOIL_LIBRARY, the SOIL library to link to
find_library(
@dogukanarat
dogukanarat / FindSDL2.cmake
Created May 18, 2024 11:07
FindSDL2 cmake module
# FindSDL2 - Find SDL2 library
# This module finds if SDL2 is installed and determines where the include
# files and libraries are. It also determines where the other SDL libraries
# (SDL2_mixer, SDL2_image, etc) are installed.
# This module defines the following variables:
# SDL2_FOUND - True if SDL2 is available
# SDL2_INCLUDE_DIRS - Where to find the SDL2 headers
# SDL2_LIBRARIES - The libraries to link against
@dogukanarat
dogukanarat / FindOpenGL.cmake
Created May 18, 2024 11:07
FindOpenGL cmake module
# FindOpenGL - Find OpenGL library
# This module finds if OpenGL is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# OPENGL_FOUND - True if OpenGL found
# OPENGL_INCLUDE_DIR - where to find gl.h, etc.
# OPENGL_LIBRARY - the name of the OpenGL library
find_library(
@dogukanarat
dogukanarat / FindGLUT.cmake
Created May 18, 2024 11:07
FindGLUT cmake module
# FindGLUT - Find GLUT library
# This module finds if GLUT is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# GLUT_FOUND, if false, do not try to link to GLUT
# GLUT_INCLUDE_DIRS, where to find the headers
# GLUT_LIBRARIES, the libraries to link against
find_library(
@dogukanarat
dogukanarat / FindGLFW.cmake
Created May 18, 2024 11:06
FindGLFW cmake module
# FindGLFW - Find GLFW library
# This module finds if GLFW is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# GLFW_FOUND, if false, do not try to link to GLFW
# GLFW_INCLUDE_DIRS, where to find the headers
# GLFW_LIBRARIES, the libraries to link against
find_library(
@dogukanarat
dogukanarat / FindGLEW.cmake
Created May 18, 2024 11:05
FindGLEW cmake module
# FindGLEW - Find GLEW library
# This module finds if GLEW is installed and determines where the include
# files and libraries are.
# This module defines the following variables:
# GLEW_FOUND, if false, do not try to link to GLEW
# GLEW_INCLUDE_DIRS, where to find the headers
# GLEW_LIBRARIES, the libraries to link against
find_library(
@dogukanarat
dogukanarat / ModuleInit.cc
Created April 21, 2024 19:32
Module init with section attributes
#include <iostream>
#define REGISTER_MODULE(module_name) InitializeFunction init_module_##module_name __attribute__((used, section("__DATA,__MODULEINIT"))) = module_name;
typedef void (*InitializeFunction)(void);
void module1(void)
{
std::cout << "module1 init..." << std::endl;
}
@dogukanarat
dogukanarat / UDevRuleCreate.md
Last active May 18, 2024 11:12
To debug some application that required peripheral connection
$ lsusb (for bus and device id)
$ udevadm info --attribute-walk /dev/bus/usb/<bus>/<device> (for attributes)
$ sudo nano /usr/lib/udev/rules.d/<rule name>.rules

SUBSYSTEM=="usb", ATTR{manufacturer}=="ARCUS", ATTR{idProduct}=="a101", GROUP="<user name>", MODE="0666"

@dogukanarat
dogukanarat / ConsoleLog.c
Created March 23, 2023 14:30
Console log functions implemented in C language
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#define COLOR_BLACK "\033[0;30m"
#define COLOR_RED "\033[0;31m"
#define COLOR_GREEN "\033[0;32m"
#define COLOR_YELLOW "\033[0;33m"
#define COLOR_BLUE "\033[0;34m"
#define COLOR_PURPLE "\033[0;35m"
./configure -prefix ~/Qt/5.12.12 -DCMAKE_OSX_ARCHITECTURES="x86_64" -static -opensource -confirm-license -debug -gui -widgets -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtwinextras -skip qtx11extras -sqlite