Skip to content

Instantly share code, notes, and snippets.

View ryancheung's full-sized avatar
🌝

Ryan Cheung ryancheung

🌝
  • Earth
View GitHub Profile
@ryancheung
ryancheung / 在 Win10 中禁用笔记本自带的键盘.md
Last active March 3, 2024 11:33
在 Win10 中禁用笔记本自带的键盘

在 Win10 中禁用笔记本自带的键盘

前记:

你们别问我为什么要禁用笔记本自带的键盘,有人就是要禁用,然后在上面放一个外接键盘。。

禁用方法

其实禁用自带的键盘很简单,只需要一个命令。

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
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 13:28
Generate self signed CA, Server and Client certs for gRPC SSL Credentials
#!/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 April 22, 2021 08:42
C# Port of the C qsort() method
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 April 8, 2021 04:49
Message Buffer implemented with unmanaged memory allocation
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 December 11, 2020 13:53
MonoGame CoreRT macOS crash report
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
231A-231B
23F0
23F3
2600-27BF
2B50
2B55
1F300-1F64F
1F680-1F6D7
1F6E0-1F6EC
1F6F0-1F6FC
// <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
{
"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",