Skip to content

Instantly share code, notes, and snippets.

View Codennnn's full-sized avatar

LeoKu Codennnn

  • Looking for new opportunities
  • Dongguan(东莞), China
View GitHub Profile
@Codennnn
Codennnn / proxy.md
Last active September 28, 2022 06:29
对 GitHub 进行 socket5 代理,提高访问速度。
# 以代理端口 7890 为例
git config --global http.https://git.521000.best.proxy socks5h://127.0.0.1:7890

# 取消代理
git config --global --unset http.https://git.521000.best.proxy
@Codennnn
Codennnn / LoadingBar.tsx
Created November 16, 2022 03:37
react loading bar
interface LoadingBarProps {
className?: string
loading?: boolean
}
export default function LoadingBar(props: LoadingBarProps) {
return (
<div className={`relative min-h-[0.25rem] ${props.className ?? ''}`}>
<div
className={`absolute inset-x-0 bottom-0 z-20 h-1 overflow-hidden py-[1px] ${
@Codennnn
Codennnn / 00-README-NEXT-SPA.md
Created March 23, 2023 07:14 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.