Skip to content

Instantly share code, notes, and snippets.

View july-12's full-sized avatar
💭
I may be slow to respond.

Faith july-12

💭
I may be slow to respond.
View GitHub Profile
@july-12
july-12 / rollup-typescript.md
Created January 12, 2023 03:34 — forked from aleclarson/rollup-typescript.md
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

@july-12
july-12 / explainer.md
Created November 25, 2022 02:01 — forked from hjlld/explainer.md
WebGPU 标准释义 - 中文版

1. 概述

WebGPU 是一个让网页可以使用系统 GPU 来实现计算和绘制复杂图形并呈现在网页内部的 Web API 提案。目标和 WebGL 家族的 API 类似,但 WebGPU 可以访问更多更高级的 GPU 特性。在 WebGL 中,其主要用途是用于绘制图形,但是经过(相当大的努力的)改造才能用于计算,而 WebGPU 则是把 GPU 通用计算作为首要支持。

1.1 使用场景

如下示例场景,未能被 WebGL 2 覆盖,需要使用 WebGPU:

  • 绘制物体数量庞大、高度细节化的场景图形(例如 CAD 模型)。WebGPU 的绘制命令的性能消耗比 WebGL 低很多。
  • 执行高级算法用于绘制逼真的场景。由于缺乏对通用计算的支持,许多现代渲染技术和优化不能在 WebGL 2 上实现。
@july-12
july-12 / next_nginx.md
Created November 10, 2021 03:47 — forked from kocisov/next_nginx.md
How to setup next.js app on nginx with letsencrypt
@july-12
july-12 / createCtx-noNullCheck.tsx
Created May 4, 2021 14:16 — forked from swyxio/createCtx-noNullCheck.tsx
better createContext APIs with setters, and no default values, in Typescript. this is documented in https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/blob/master/README.md#context
// create context with no upfront defaultValue
// without having to do undefined check all the time
function createCtx<A>() {
const ctx = React.createContext<A | undefined>(undefined)
function useCtx() {
const c = React.useContext(ctx)
if (!c) throw new Error("useCtx must be inside a Provider with a value")
return c
}
return [useCtx, ctx.Provider] as const
@july-12
july-12 / CDN.md
Created April 20, 2020 12:12 — forked from vinkla/CDN.md
A guide on how to upload images to GitHub's CDN through issues and pull requests.

Upload Images to GitHub's CDN

  1. First, visit any repository on GitHub and click your way through to the issues page.

  2. Create a new issue by clicking the New Issue button. You'll now see title and description fields.

  3. Drag-and-drop an image onto the description field. This will start the uploading process.

  4. Copy the URL and use it in README, issues or pull requests however you like.

@july-12
july-12 / vim_cheatsheet.md
Created December 26, 2019 03:07 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@july-12
july-12 / .gitignore
Created September 19, 2018 02:20 — forked from ericelliott/.gitignore
Sample Node project .gitignore
node_modules
build
npm-debug.log
.env
.DS_Store
@july-12
july-12 / server.conf
Created December 8, 2016 06:29 — forked from nkt/server.conf
Nginx configuration for separated frontend and backend endpoints
upstream example-webpack {
server 127.0.0.1:8080;
}
upstream example-backend {
server 127.0.0.1:3000;
}
server {
listen 80;
# As root user
sudo su
# Update the OS
apt-get update -y
# Add this to ~/.bashrc to remove timezone warnings
export LC_ALL="en_US.UTF-8"
source ~/.bashrc