Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Cheung ryancheung

  • Earth
View GitHub Profile
View qt-static-build.txt
configure -prefix C:\\Qt_static_5.12.0-32bit -release -opensource -static -static-runtime -opengl desktop -no-feature-d3d12 -nomake examples -nomake tests -mp -confirm-license
View DpiHelper.cs
using System;
using System.Runtime.InteropServices;
public static class SHCore
{
public enum PROCESS_DPI_AWARENESS : int
{
UNAWARE = 0,
SYSTEM_AWARE = 1,
PER_MONITOR_AWARE = 2
@ryancheung
ryancheung / generate_certs.sh
Created May 12, 2021
Generate self signed CA, Server and Client certs for gRPC SSL Credentials
View generate_certs.sh
#!/bin/bash
PASS=jing0518
SERVER_HOST=localhost
CLIENT_HOST=localhost
####################################
echo Generate CA key:
openssl genrsa -passout pass:$PASS -des3 -out Endless_ca.key 4096
@ryancheung
ryancheung / QuickSort.cs
Created Apr 22, 2021
C# Port of the C qsort() method
View QuickSort.cs
public static unsafe class QuickSort
{
static void swapcode<T>(byte* parmi, byte* parmj, int n) where T : unmanaged
{
var i = (n) / sizeof(T);
T* pi = (T*)parmi;
T* pj = (T*)parmj;
do
{
@ryancheung
ryancheung / HGMessageBuffer.cs
Created Apr 8, 2021
Message Buffer implemented with unmanaged memory allocation
View HGMessageBuffer.cs
public unsafe class HGMessageBuffer : IDisposable
{
public const int DefaultSize = 0x20;
private int _wpos;
private int _rpos;
private IntPtr _storage;
private int _size;
@ryancheung
ryancheung / gist:694f75e42649bbe95c30e5048527970e
Last active Dec 11, 2020
MonoGame CoreRT macOS crash report
View gist:694f75e42649bbe95c30e5048527970e
Process: Foo [7892]
Path: /Users/USER/*/Foo.app/Contents/MacOS/Foo
Identifier: com.foo.foo
Version: 1.0 (1.0.0)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Foo [7892]
User ID: 501
Date/Time: 2020-12-11 21:49:29.917 +0800
View MessagePackGenerated.cs
// <auto-generated>
// THIS (.cs) FILE IS GENERATED BY MPC(MessagePack-CSharp). DO NOT CHANGE IT.
// </auto-generated>
#pragma warning disable 618
#pragma warning disable 612
#pragma warning disable 414
#pragma warning disable 168
#pragma warning disable SA1200 // Using directives should be placed correctly
View freetype.cmake.vscode.settings.json
{
"cmake.buildDirectory": "${workspaceRoot}/build",
"cmake.configureSettings": {
"CMAKE_VERBOSE_MAKEFILE": true,
//"CMAKE_EXPORT_COMPILE_COMMANDS": true,
//"CMAKE_C_FLAGS_RELEASE": "-g0",
//"CMAKE_TOOLCHAIN_FILE": "E:/Android/android-ndk-r21/build/cmake/android.toolchain.cmake",
//"ANDROID_ABI": "arm64-v8a",
//"ANDROID_ABI": "armeabi-v7a",
//"ANDROID_ABI": "x86",
View freetype2.10.1.win64.patch
From 92900076c55cd35cd8a327bf009cd1f8beebb479 Mon Sep 17 00:00:00 2001
From: ryancheung <ryancheung.go@gmail.com>
Date: Fri, 20 Mar 2020 18:23:38 +0800
Subject: [PATCH] Win64 patch
---
include/freetype/ftimage.h | 6 +++++-
include/freetype/fttypes.h | 24 ++++++++++++++++++++----
2 files changed, 25 insertions(+), 5 deletions(-)