This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define WIN32_LEAN_AND_MEAN | |
#define NOMINMAX | |
#include <atomic> | |
#include <chrono> | |
#include <thread> | |
#include <type_traits> | |
#include <windows.h> | |
#include <combaseapi.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ... | |
-- 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 *);") | |
end | |
return ffi.C._putenv("LOVE_GRAPHICS_USE_GL2=1") == 0 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 httptunnel.py | |
# * then the other terminal to download the videos with youtube-dl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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") | |
ffi.cdef[[ | |
int __stdcall timeBeginPeriod(uint32_t); | |
void* __stdcall CreateRemoteThread(void*, void*, size_t, void*, void*, uint32_t, uint32_t*); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This PKGBUILD is based on community love package and AUR love-hg package. | |
# * love (https://www.archlinux.org/packages/community/x86_64/love) | |
# For the dependency list | |
# * love-hg (https://aur.archlinux.org/packages/love-hg) | |
# For the building block | |
pkgname=love-git | |
pkgver=11.3.r3665.9f62bafea2b8 | |
pkgrel=1 | |
pkgdesc="An open-source 2D game engine which uses the versatile Lua scripting language to create dynamic gaming experiences." | |
arch=('i686' 'x86_64') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Reorder WAV chunks files | |
-- This often useful if particular program expects "WAVE" identifier | |
-- followed by "fmt " chunk and followed by "data " chunk. Particularly | |
-- GTA San Andreas User Tracks. | |
-- You can use part or all of this code without my permissions. | |
local arg = {...} | |
local fin = assert(io.open(assert(arg[1], "need input file"), "rb")) | |
local fout = assert(io.open(assert(arg[2], "need output file"), "wb")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Using MSVC toolchain, compile this as follows | |
$ clang.exe -target i386-pc-windows-msvc -shared -o dummy.dll dummy.cpp | |
*/ | |
#include <cstdio> | |
struct __declspec(dllexport) DummyBase | |
{ | |
int someValue; |