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
https://gorails.com/deploy/ubuntu/18.04#vps
@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.

参考 https://mirror.tuna.tsinghua.edu.cn/help/CocoaPods/
对于旧版的 CocoaPods 可以使用如下方法使用 tuna 的镜像:
```
$ pod repo remove master
$ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
$ pod repo update
```
新版的 CocoaPods 不允许用pod repo add直接添加master库了,但是依然可以:
@july-12
july-12 / powerlevel9k
Created January 2, 2020 11:43
powerlevel9k
POWERLEVEL9K_MODE=nerdfont-complete
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
POWERLEVEL9K=truncate_beginning
POWERLEVEL9K_TIME_BACKGROUND=black
POWERLEVEL9K_TIME_FOREGROUND=white
POWERLEVEL9K_TIME_FORMAT=%D{%I:%M}
POWERLEVEL9K_STATUS_VERBOSE=false
POWERLEVEL9K_VCS_CLEAN_FOREGROUND=black
@july-12
july-12 / replace homebrew mirrors
Last active January 2, 2020 03:31
替换homebrew镜像源
当我们brew update或者brew install xxx时,异常的慢,本事原因还是国内网络环境github下载慢导致。
我们可以更换Homebrew源, 从https://mirrors.ustc.edu.cn/上搜索各对应的源
cd "$(brew --repo)" (正常放置在/usr/local/Homebrew)
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git/
# 替换homebrew-core
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git/
@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