Skip to content

Instantly share code, notes, and snippets.

View batunpc's full-sized avatar
:octocat:
٩(◔.◔)۶

Batuhan Ipci batunpc

:octocat:
٩(◔.◔)۶
View GitHub Profile
@batunpc
batunpc / CMakeLists.txt
Created January 1, 2023 05:13
use heapcheck with CMake
# Set the path to the GPerfTools library
find_library(GPERFTOOLS_LIBRARIES tcmalloc)
# Set the flags needed to build with heapcheck
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
# Add the heapcheck library to your target
target_link_libraries(my_target ${GPERFTOOLS_LIBRARIES})
@batunpc
batunpc / poem.sh
Created December 19, 2022 01:00
Poem typewriter with animation in your terminal
poem() {
# get random poem from api
local poem=$(curl -s https://poetrydb.org/random | jq -r '.[0].lines[]')
# print poem
echo
autoload -U colors
colors
echo $bold_color "$poem" | pv -qL 7
}
@batunpc
batunpc / launch.json
Last active December 20, 2022 20:36
C++ setup for `.vscode` using cmake tools on M1 Macbook.
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug",
"type": "cppdbg",
"request": "launch",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [