Skip to content

Instantly share code, notes, and snippets.


Miku AuahDark MikuAuahDark

View GitHub Profile
MikuAuahDark / koikatu_check.cpp
Last active Apr 8, 2021
Rust code to check if PNG is KoiKatuChara or KoiKatuClothes
View koikatu_check.cpp
// Code to check whetever PNG image is normal PNG image or it also contain
// Koikatu data like character or clothes.
// Copyright (c) 2021 Miku AuahDark
// You can use portion of this code or as a whole without my permission.
// clang++ -std=c++17 -D_CRT_SECURE_NO_WARNINGS koikatu_check.cpp
#include <cerrno>
#include <cstdio>
MikuAuahDark /
Last active Mar 2, 2021
Uniform Cost Search in Java 8
// Sisi
public class Edge {
public Edge(Vertex a, Vertex b, int cost) {
this.a = a;
this.b = b;
this.cost = cost;
public Vertex getA() {
return a;
MikuAuahDark / capture.cpp
Created Jan 6, 2021
Simple peak meter with ANSI escape codes written in C++ using WASAPI audio loopback as audio measurement.
View capture.cpp
#define NOMINMAX
#include <atomic>
#include <chrono>
#include <thread>
#include <type_traits>
#include <windows.h>
#include <combaseapi.h>
MikuAuahDark / conf.lua
Created Dec 19, 2020
Force GL2 in LOVE
View conf.lua
-- ...
-- Add before love.conf function, typically at top of the file
local function forceGL2()
local ffi = require("ffi")
if not pcall(function() return ffi.C._putenv end) then
ffi.cdef("int _putenv(const char *);")
return ffi.C._putenv("LOVE_GRAPHICS_USE_GL2=1") == 0
View main.c
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <AL/al.h>
#include <AL/alc.h>
#include "sleep.h"
MikuAuahDark /
Last active Nov 4, 2020
Lazy HTTP Tunnel/CONNECT Proxy in Python 3.7+ using Cloudflare as DNS Resolver
# HTTP tunneling with DoH resolver
# The motivation to write this is because youtube-dl lack DoH or cURL
# "--resolve" equivalent which prevents me from downloading reddit videos
# because all reddit (sub)domains are blocked in my country.
# To use this proxy, you need 2 terminals.
# * 1 terminal is to run this proxy server:
# $ python3
# * then the other terminal to download the videos with youtube-dl
MikuAuahDark / timerhack.lua
Last active Oct 11, 2020
timeBeginPeriod inject
View timerhack.lua
-- This code injects call to "timeBeginPeriod" to specified PID
-- Note that it's inadvisable to set the timer resolution
-- as it can affect battery life and your electricity bills.
-- Attribution to MikuAuahDark (me) is appreciated, but you can
-- use part or all of this code without my permission.
local ffi = require("ffi")
int __stdcall timeBeginPeriod(uint32_t);
void* __stdcall CreateRemoteThread(void*, void*, size_t, void*, void*, uint32_t, uint32_t*);
View uds_client.c
/* clang uds_client.c -lws2_32 -Wno-deprecated-declarations */
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <winsock2.h>
#include <windows.h>
struct sockaddr_un
MikuAuahDark / PKGBUILD
Last active Sep 8, 2020
# This PKGBUILD is based on community love package and AUR love-hg package.
# * love (
# For the dependency list
# * love-hg (
# For the building block
pkgdesc="An open-source 2D game engine which uses the versatile Lua scripting language to create dynamic gaming experiences."
arch=('i686' 'x86_64')
MikuAuahDark / main.cpp
Last active Sep 6, 2020
Z -> Left Click in Krita + X11
View main.cpp
// You can use part or all of this code without my permission
// $ clang++ main.cpp -lX11 -lXtst -lpthread
#include <csignal>
#include <chrono>
#include <iostream>
#include <string>
#include <thread>