Skip to content

Instantly share code, notes, and snippets.

View xeechou's full-sized avatar
🏠
Working from home

Xichen Zhou xeechou

🏠
Working from home
View GitHub Profile
@xeechou
xeechou / shortcut.ahk
Created September 22, 2023 16:55
How windows hot key setup
LCtrl::Alt
LAlt::Ctrl
#SuspendExempt
f1::Suspend ; Ctrl+Alt+S
#SuspendExempt False
#SuspendExempt
+CapsLock::
{
@xeechou
xeechou / spherical.comp
Last active September 13, 2023 20:30
gen 3d direction
//x is theta in range(0, pi), y is phi in range(0, 2pi), solid angle pi/8
layout(local_size_x = 8, local_size_y = 16, local_size_z = 1) in;
//using local group for theta and phi
#define M_PI 3.141592653f
vec3 get_direction()
{
vec2 pos = vec2(gl_LocalInvocationID.xy) / vec2(gl_WorkGroupSize.xy);
@xeechou
xeechou / settings.json
Created January 29, 2023 17:13
Msys2 profile for windows terminal
{
"guid": "{17da3cac-b318-431e-8a3e-7fcdefe6d114}",
"name": "mingw64 / MSYS2",
"commandline": "C:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64",
"startingDirectory": "C:/msys64/home/%USERNAME%",
"icon": "C:/msys64/mingw64.ico",
"font":
{
"face": "Lucida Console",
"size": 12
@xeechou
xeechou / inline-image.tex
Created January 20, 2023 14:10
inline figure in latex
\newcommand*{\img-inline}[1]{%
\raisebox{-.1\baselineskip}{%
\includegraphics[
height=0.8\baselineskip,
width=0.8\baselineskip,
keepaspectratio,
]{#1}%
}%
}
@xeechou
xeechou / gm-block-youtube-list.js
Created December 6, 2022 01:35
Grease Monkey Script to Block youtube playlist
// ==UserScript==
// @namespace https://xeechou.net/gmscripts
// @name Blocking youtube play list
// @version 1
// @grant GM_addStyle
// @include https://www.youtube.com/*
// ==/UserScript==
function GM_addStyle(css) {
@xeechou
xeechou / sample.vs
Last active September 23, 2022 17:35
HLSL: multiple struct parameters in entry point
struct VSBasicIn
{
[[vk::location(0)]] float4 Pos : POSITION;
[[vk::location(1)]] float3 Norm : NORMAL;
[[vk::location(2)]] float2 Tex : TEXCOORD0;
};
struct VSBasicIn1
{
[[vk::location(3)]] float4 tangent : TANGENT;
@xeechou
xeechou / sample.vert
Last active September 23, 2022 17:36
use of ssbo and texturebuffer in vertex shader
#version 460
#extension GL_GOOGLE_include_directive : require
// ------------------------------------------------------------------------
// INPUTS -----------------------------------------------------------------
// ------------------------------------------------------------------------
layout(location = 0) in vec3 VS_IN_Position;
include(CompileShader)
find_program(DXC_EXE NAMES dxc REQUIRED)
if (NOT DXC_EXE)
message(FATAL "The dxc executable is not available. You must install it")
endif()
################################################################################
macro(compile_hlsl_parse_options)
@xeechou
xeechou / PKGBUILD
Last active February 28, 2022 15:24
PKGBUILD file for directx-shader-compiler
# Maintainer: Robert Manner <the_manni at users.sf.net>
pkgname=directx-shader-compiler
_pkgname=DirectXShaderCompiler
pkgdesc="A compiler for HLSL to DXIL (DirectX Intermediate Language)."
pkgver=1.6.2106
pkgrel=1
arch=('x86_64')
url="https://github.com/microsoft/${_pkgname}"
license=('BSD') # NCSA
@xeechou
xeechou / treevec_imgui.hpp
Last active November 25, 2021 02:49
Dynamic TreeNodes using ImGUI
#pragma once
#include <stack>
#include <vector>
#include <stack>
#include <utility>
#include <functional>
#include <tuple>
#include <imgui.h>