Skip to content

Instantly share code, notes, and snippets.

View pissang's full-sized avatar

Yi Shen pissang

View GitHub Profile
@pissang
pissang / wave.svg
Created November 25, 2021 08:44
wave.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pissang
pissang / canvaskit-path-demo.html
Created May 26, 2021 05:24
CanvasKit Path Draw
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
</head>
<body>
<canvas id="foo" width="300" height="300"></canvas>
<script
@pissang
pissang / ts-type-guide.md
Last active May 10, 2024 08:45
TypeScript 类型编写指南

TypeScript 类型编写指南

前言

本文主要作为平时在 TypeScript 代码中编写类型以及对 TypeScript 代码进行 review 时候的参考手册,并非强制执行的规范,也不涉及纯代码风格以及代码逻辑上的指导。

前置阅读

本文内容参考了下面几个手册,所以强烈建议能够同时阅读完这几个手册。如果大家对 TypeScript 的一些基础用法和特性还不熟悉,也建议先阅读第一个 TypeScript 手册。

@pissang
pissang / generate-changelog.js
Last active January 11, 2021 14:38
Generate changelog for ECharts
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({
// auth: ''
});
const OWNER = 'apache';
const REPO = 'incubator-echarts';
const MILESTONE = 21;
const glob = require('glob');
const child_process = require('child_process');
const util = require('util');
const exec = util.promisify(child_process.exec);
glob('src/**/*.js', async (err, files) => {
console.log(files);
for (let file of files) {
await exec(`git mv ${file} ${file.replace('.js', '.ts')}`);
}
@pissang
pissang / milestone2planitpoker.js
Created November 1, 2019 06:24
Github Milestone 2 Planitpoker
const fetch = require('node-fetch');
const MILESTONE_NUMBER = 15;
function assembleIssues(issues) {
return issues.map(issue => {
if (issue.state === 'open') {
return '#' + issue.number + ' ' + issue.title;
}
@pissang
pissang / filter.glsl
Last active February 2, 2023 19:22
Shader Code from Edge-Avoiding À-Trous Wavelet Transform for fast Global Illumination Filtering https://github.com/LWJGL/lwjgl3-demos/blob/master/res/org/lwjgl/demo/opengl/raytracing/tutorial8/atrous.fs.glsl
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
*/
/**
* This is a 1:1 implementation/copy of the GLSL algorithm shown at the
* end of the 2010 paper "Edge-Avoiding À-Trous Wavelet Transform for
* fast Global Illumination Filtering"
*
* https://jo.dreggn.org/home/2010_atrous.pdf
const MIME = 'video/webm';
const MIME_CODEC = 'video/webm; codecs="vp8"';
const FILE_EXT = 'webm';
class CanvasRecorder {
constructor() {
this.recordedBlobs_ = [];
this.mediaRecorder_ = null;
@pissang
pissang / echarts-svg.js
Last active August 23, 2024 03:34
Server side SVG rendering of ECharts
const echarts = require("echarts");
const Canvas = require('canvas');
const {JSDOM} = require('jsdom');
const fs = require('fs');
echarts.setCanvasCreator(() => {
return new Canvas(100, 100);
});
const {window} = new JSDOM();
global.window = window;
@pissang
pissang / index.html
Last active February 14, 2018 14:49
ClayGL minimal project, bundle file is 39kb after gziped
<html>
<body>
<canvas id="main" style="width:400px;height:400px;"></canvas>
<script src="./dist/bundle.js"></script>
</body>
</html>