Skip to content

Instantly share code, notes, and snippets.

View include-yy's full-sized avatar
😇
愛と勇気の歌

YI YUE include-yy

😇
愛と勇気の歌
View GitHub Profile
@include-yy
include-yy / README.md
Last active February 14, 2024 18:14
A naive implementation of WGSL's parser in tree-sitter

tree-sitter-wgsl --- simple impl of WGSL parser in tree-sitter

本 gist 是对 WGSL-20240205 标准的一个简单 tree-sitter 实现

如何使用

参考官方教程,通过 npm 安装 tree-sitter-cli,将 grammar.js 放在项目根目录,scanner.c 放在 src 目录,通过 tree-sitter generate 命令生成可用的 tree-sitter parser。

本 gist 代码参考了以下项目:

@include-yy
include-yy / index.html
Last active December 25, 2023 05:16
first webgpu app
<html>
<head>
<meta charset="utf-8">
<title>First WebGPU APP</title>
</head>
<body>
<canvas width="720" height="720"></canvas>
</body>
<script src="./index.js"></script>
</html>
cmake_minimum_required(VERSION 3.14)
project(unitree_guide)
set(ROBOT_TYPE Go1) # The type of robot, support Go1 and A1 currently
set(PLATFORM amd64) # The platform to compile, support amd64 and arm64
set(CATKIN_MAKE ON) # Use CATKIN_MAKE or not, ON or OFF
set(SIMULATION ON) # Use Gazebo or not, ON or OFF
set(REAL_ROBOT OFF) # Link real robot or not, ON or OFF
set(DEBUG OFF) # Use debug functions or not, ON or OFF
@include-yy
include-yy / init.el
Last active August 18, 2024 17:12
include-yy's emacs config file
;;; init.el --- include-yy's emacs config -*- lexical-binding:t;no-byte-compile:t; -*-
;; Copyright (C) 2023 include-yy <yy@egh0bww1.com>
;; Author: include-yy <yy@egh0bww1.com>
;; Created: 17 Jun 2023
;; Version: 0.1
;; Keywords: config
;; URL: https://gist.github.com/include-yy/e70dcbfc1a80403814d0b7a7357971d9
@include-yy
include-yy / Readme.md
Created February 5, 2023 07:13
simple org html export config

对 ox-html 的一些 advice

记得打开 org-html-prefer-user-labels

@include-yy
include-yy / README.md
Last active September 2, 2023 10:57
soft serial port implemented in python

使用 Python 实现的软串口

该程序实现的功能是:两个线程通过 UART 串口协议进行通信,发送比特的时间间隔为 1s,虚拟时钟为 4hz。线程在收到数字后加 1 重新发送,直到接收的数字大于 3 为止。

直接使用 Python 运行即可:

python port.py
@include-yy
include-yy / README.md
Last active November 4, 2024 07:02
ray tracing in one weekend implemented in ReScript
@include-yy
include-yy / README.md
Last active November 20, 2022 05:26
test Rescript uncurry and array unsafe operation

对计算函数的反柯里化测试

  • c 后缀表示去柯里化
  • unsafe 后缀表示使用了无检查的数组操作
  • add 后缀表示直接进行加法,不使用加法函数
  • s 后缀表示带副作用操作
  • n 后缀表示创建新的结果向量,不使用默认提供的结果向量
@include-yy
include-yy / README.md
Last active October 7, 2022 02:46
brainfuck implemented in elisp

yybf —— brainfuck implemented in elisp

  • yybf1.el 纯解释实现
  • ☉-execute 接受 brainfuck 代码字符串并执行
@include-yy
include-yy / README.md
Last active September 2, 2023 10:57
simple Common Lisp gv feature

setf 的一个实现

  • yy-ref-table 获取哈希表中的值

  • yy-set-table 设置哈希表键值对

  • yy-clr-hash 清空哈希表

  • yy-dse define-setf-expander