Skip to content

Instantly share code, notes, and snippets.

View Youlean's full-sized avatar

Julijan Nikolic Youlean

View GitHub Profile
@Youlean
Youlean / core_audio_tap_example.m
Created August 14, 2024 17:24 — forked from directmusic/core_audio_tap_example.m
An example how to use the new Core Audio Tap API in macOS 14.2.
// This is a quick example of how to use the CoreAudio API and the new Tapping
// API to create a tap on the default audio device. You need macOS 14.2 or
// later.
// Build command:
// clang -framework Foundation -framework CoreAudio main.m -o tapping
// License: You're welcome to do whatever you want with this code. If you do
// something cool please tell me though. I would love to hear about it!
@Youlean
Youlean / gist:5ea7fce073b4c342117ef4334547b017
Created May 15, 2023 12:03
Check allocations with new override
#pragma once
#include <iostream>
#include <thread>
#ifdef _DEBUG
static std::thread::id YOULEAN_ALLOCATOR_MAIN_THREAD_ID = std::thread::id();
static std::thread::id YOULEAN_ALLOCATOR_AUDIO_THREAD_ID = std::thread::id();
@Youlean
Youlean / gist:daed25b08861eed0a4b90ddd8e9559d1
Created October 15, 2022 11:16
Print Visual Studio Warning
// Required code
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#define warning_vs(t) message(__FILE__ "(" STRING(__LINE__) "): warning: " STRING(t))
// Example Usage
#pragma warning_vs("This is my custom warning")
// Easing
const float PI2 = PI * 2;
inline float LinearEase(float p)
{
return p;
}
inline float QuadraticEaseIn(float p)
#pragma once
#include <fstream>
#include <codecvt>
class Windows_UTF_Converter
{
public:
#ifdef WIN32
std::string utf8_to_ansi(std::string s)