Skip to content

Instantly share code, notes, and snippets.

View aferust's full-sized avatar
💭
I may be slow to respond.

Ferhat Kurtulmuş aferust

💭
I may be slow to respond.
  • Bursa
View GitHub Profile
@aferust
aferust / dlang tcp server
Created September 24, 2020 11:24
dlang tcp server
import std.stdio;
import std.socket;
class TCPServer{
string host;
ushort port;
@disable this();
module app;
import std.conv;
import std.process;
import beamui;
mixin RegisterPlatforms;
int main()
import core.stdc.stdio;
import bindbc.nanovg;
import bindbc.glfw;
import bindbc.opengl;
@nogc nothrow:
int initNanovg(){
version(BindNanovg_Static){
@aferust
aferust / gist:898a96fdfe23e72ce14685c7e0250e56
Last active September 23, 2023 21:44
BetterC threadpool
// WIP
import dvector;
import deimos.uv;
struct UVThread {
alias CBDelegate = void delegate(void*, void*) @nogc nothrow;
alias CBFunPtr = void function(void*, void*) @nogc nothrow;
import core.stdc.stdio;
import core.sys.windows.windows;
struct UserData {
int data;
}
extern (Windows) uint t1(void* data) {
auto tid = GetCurrentThreadId();
auto dt = *(cast(UserData*)data);