Skip to content

Instantly share code, notes, and snippets.

@wayhoww
wayhoww / converter.h
Created January 3, 2021 16:18
Boost.Python: Automatical Type Conversion
/**
* For Boost.Python
*
* Automatically convert between Python list, dict, tuple and C++ STL std::vector, std::map, std::tuple, respectively.
* --------------------------------------
* 自动转换 Python 和 STL 的几个常用数据类型。
*
* I am familiar with neither metaprogramming nor Boost.Python. This header works but I believe
* there are better ways (or even existing libraries) to do these conversions. Please comment at
* this page to help me improve it.
@mattbell87
mattbell87 / remote-wsl.md
Last active April 25, 2025 17:28
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
@Popov72
Popov72 / using_pix_with_canary.md
Last active April 12, 2025 19:25
Using PIX with Chrome

In PIX, Select Target Process => Launch Win32 and set the following 2 entries according to where Canary / Chrome is installed:

  • Path to executable: "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application\chrome.exe"
  • Working directory: "C:\Users\alexis\AppData\Local\Google\Chrome SxS\Application"
  • Command line arguments: --disable-gpu-sandbox --disable-direct-composition
    • You can add those arguments if you want to be able to see the disassembled shader code: --enable-dawn-features=emit_hlsl_debug_symbols,disable_symbol_renaming
  • Launch Suspended unchecked, Launch for GPU capture and Force D3D11On12 checked

Then click on "Launch".

Important: you should close all your Canary / Chrome windows/processes before clicking on the "Launch" button!

@72lions
72lions / concat.array.buffers.js
Created January 14, 2013 09:22
Concatenates two ArrayBuffers
/**
* Creates a new Uint8Array based on two different ArrayBuffers
*
* @private
* @param {ArrayBuffers} buffer1 The first buffer.
* @param {ArrayBuffers} buffer2 The second buffer.
* @return {ArrayBuffers} The new ArrayBuffer created out of the two.
*/
var _appendBuffer = function(buffer1, buffer2) {
var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);