Skip to content

Instantly share code, notes, and snippets.

@myd7349
myd7349 / speedada.cpp
Created January 27, 2026 05:51 — forked from bagder/speedada.cpp
measure ada URL parsing the same way speedparse does
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
#include <uv.h>
static void on_close(uv_handle_t* handle);
static void on_connect(uv_connect_t* req, int status);
static void on_write(uv_write_t* req, int status);
static void on_alloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf)
@myd7349
myd7349 / http_client_get.cc
Created January 27, 2026 05:47 — forked from AhnMo/http_client_get.cc
Wininet HTTP Client Example
#include <windows.h>
#include <wininet.h>
#include <stdio.h>
#pragma comment (lib, "Wininet.lib")
int main(int argc, char *argv[]) {
HINTERNET hSession = InternetOpen(
L"Mozilla/5.0", // User-Agent
#include <memory>
#include <cassert>
#include <Windows.h>
struct FileHandle
{
::HANDLE fileHandle;
//implicit
FileHandle(::HANDLE h) noexcept
@myd7349
myd7349 / CMakeLists.txt
Created January 12, 2026 02:01 — forked from SamuelMarks/CMakeLists.txt
CMake hacks to create a Bundle for macOS
if (BUILD_APPLE_BUNDLE)
set(EXEC_NAME "MyUI")
else ()
get_filename_component(EXEC_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
string(APPEND EXEC_NAME "-${PROJECT_VERSION}")
endif ()
set(Source_Files "main.c")
source_group("Source Files" FILES "${Source_Files}")
@myd7349
myd7349 / IpcClientServer.cs
Created December 28, 2025 08:49 — forked from VPKSoft/IpcClientServer.cs
A class for IPC channel messaging.
#region license
/*
This file is public domain.
You may freely do anything with it.
Copyright (c) VPKSoft 2019
*/
#endregion
using System;
@myd7349
myd7349 / WinMain.cpp
Created December 14, 2025 04:05 — forked from rhoot/WinMain.cpp
Win32 application entry point redirection
/** \file WinMain.cpp
* \author rhoot <https://github.com/rhoot>
*
* \brief Redirects calls from the windows specific WinMain() entry point to a more
* standard main() entry point defined someplace else. In debug builds, also
* allocates a console and redirects stdin, stderr, stdout to that console.
*
* \remark The std* stream redirection is based on RedirectIOToConsole(), as can be found
* at http://dslweb.nwnexus.com/~ast/dload/guicon.htm.
*/
@myd7349
myd7349 / Program.cs
Created December 6, 2025 01:55 — forked from murphybytes/Program.cs
Demonstrates using pinvoke to pass a callback from a .net managed application to a C dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace MyCSharpApp
{
Rem run as administrator
@echo on & @setlocal enableextensions
@echo =========================
@echo Turn off the time service
net stop w32time
@echo ======================================================================
@echo Set the SNTP (Simple Network Time Protocol) source for the time server
w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
@echo =============================================
@echo ... and then turn on the time service back on
@myd7349
myd7349 / lz76benchmarks.py
Created November 6, 2025 08:09 — forked from pranaysy/lz76benchmarks.py
Comparison of LZ76 complexity implementations
"""
A demo comparison of three different implementations for estimating Lempel-Ziv complexity (1976)
Implementations compared:
- Pure Python version, by Naereen
- Numba (str), as implemented in EntroPy by Raphael Vallat
- Numba, updated for speed, based on numpy integer arrays
Simple comparisons for equality of estimates and performance to address issue:
https://github.com/raphaelvallat/entropy/issues/14