This file contains hidden or 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
$ cat /etc/issue | |
Arch Linux \r (\l) | |
$ uname -a | |
Linux alarm3 4.20.8-1-ARCH #1 SMP Tue Feb 12 21:12:07 MST 2019 aarch64 GNU/Linux | |
##### EGL info | |
EGL client extensions = EGL_EXT_client_extensions EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug EGL_MESA_platform_gbm |
This file contains hidden or 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
$ cat /etc/issue | |
Arch Linux \r (\l) | |
$ uname -a | |
Linux alarm0 4.14.98-1-ARCH #1 SMP Wed Feb 13 04:28:06 UTC 2019 armv6l GNU/Linux | |
##### EGL info | |
EGL client extensions = EGL_EXT_client_extensions EGL_EXT_device_base EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug EGL_MESA_platform_gbm |
This file contains hidden or 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
#!/usr/bin/env python3 | |
import sys | |
import tarfile | |
import zipfile | |
from pathlib import Path | |
src = sys.argv[1] | |
dst = Path(src).name + ".zip" |
This file contains hidden or 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 <stddef.h> | |
#include <stdint.h> | |
#include <intrin.h> | |
// see aeshashbody in https://github.com/golang/go/blob/master/src/runtime/asm_amd64.s | |
// this is initialized on process startup with random from system | |
static __declspec(align(16)) uint8_t aeskeysched[128]; | |
static __declspec(align(16)) const uint8_t masks[16][16] = |
This file contains hidden or 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 | |
#include <windows.h> | |
#include <dwrite.h> | |
#include <intrin.h> | |
#pragma comment (lib, "gdi32.lib") | |
#pragma comment (lib, "user32.lib") | |
#pragma comment (lib, "dwrite.lib") | |
#define CHECK(x) do { if (!(x)) __debugbreak(); } while (0) |
This file contains hidden or 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
// floor function for floats with SSE1 or SSE2 | |
#include <emmintrin.h> | |
#include <smmintrin.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> | |
#else | |
#define __rdtsc() __builtin_ia32_rdtsc() | |
#endif |
This file contains hidden or 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
// compile this to hook.dll | |
// for example, with MSVC: cl.exe /LD /MT /O2 hook.c /Fehook.dll | |
#include <windows.h> | |
// get this from https://github.com/kubo/plthook | |
#include "plthook_win32.c" | |
static plthook_t* hook; |
This file contains hidden or 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
// gcc test.c `pkg-config --cflags --libs gtk+-3.0 gdk-3.0` -lX11 && ./a.out | |
#include <X11/Xlib.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <gtk/gtk.h> | |
#include <gdk/gdkx.h> | |
static void my_gtk_realize(GtkWidget* widget, gpointer user) |
This file contains hidden or 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 <windows.h> | |
extern "C" | |
{ | |
#pragma section(".CRT$XIA",long,read) | |
#pragma section(".CRT$XIZ",long,read) | |
#pragma section(".CRT$XCA",long,read) | |
#pragma section(".CRT$XCZ",long,read) | |
#pragma section(".CRT$XPA",long,read) | |
#pragma section(".CRT$XPZ",long,read) |
This file contains hidden or 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
@echo off | |
setlocal EnableDelayedExpansion | |
set BUILD_CACHE=%~dp0\_build_cache.cmd | |
if exist "!BUILD_CACHE!" ( | |
rem cache file exists, so call it to set env variables very fast | |
call "!BUILD_CACHE!" | |
) else ( | |
if not exist "%VS2019INSTALLDIR%\VC\Auxiliary\Build\vcvarsall.bat" ( |