Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Frank Fang FrankFang

🎯
Focusing
View GitHub Profile
View my_vscode_exts.sh
code --install-extension 13xforever.language-x86-64-assembly
code --install-extension 2gua.rainbow-brackets
code --install-extension alefragnani.project-manager
code --install-extension alexcvzz.vscode-sqlite
code --install-extension antfu.browse-lite
code --install-extension antfu.unocss
code --install-extension antfu.vite
code --install-extension bung87.vscode-gemfile
code --install-extension castwide.solargraph
code --install-extension christian-kohler.npm-intellisense
View shims.d.ts
import * as React from 'react'
declare module 'react' {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
flex?: boolean
relative?: boolean
text?: string
grid?: boolean
before?: string
after?: string
shadow?: boolean
View .eslintrc
{
"extends": "@antfu",
"rules": {
"curly": "off",
"arrow-parens": "off",
"@typescript-eslint/brace-style": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
@FrankFang
FrankFang / svgsprites.ts
Last active February 10, 2023 17:15
A Vite plugin for generating svg sprites
View svgsprites.ts
import path from 'path'
import fs from 'fs'
import store from 'svgstore'
import { optimize } from 'svgo'
import type { Plugin, ViteDevServer } from 'vite'
interface Options {
id?: string
inputFolder?: string
inline?: boolean
View go-datatypes.go
package main
import (
"fmt"
"math"
)
func main() {
var age int8 = 18 // -128 ~ 127
var daysToLive int16 = 10_000 // -32768 ~ 32767
@FrankFang
FrankFang / x11.sh
Created September 22, 2021 03:08
x11 on headless server
View x11.sh
apk add libx11-dev
apk add xvfb
Xvfb :99 -screen 0 1024x768x24
export DISPLAY=:99.0
xclip -selection clipboard -t image/png -i dog.jpg
echo "123" | xclip -selection clipboard
View monokai-frank.icls
<scheme name="Monokai - Frank" version="142" parent_scheme="Darcula">
<metaInfo>
<property name="created">2020-04-12T15:35:52</property>
<property name="ide">WebStorm</property>
<property name="ideVersion">2020.1.0.0</property>
<property name="modified">2020-12-09T16:19:39</property>
<property name="originalScheme">_@user_Monokai</property>
</metaInfo>
<colors>
<option name="CARET_COLOR" value="f8f8f0" />
View f1.ahk
; ! is Alt
; + is Shift
; ^ is Ctrl
; # is Win
F1::
Send {LWin Down}{1}{LWin Up}
return
CapsLock::SetCapsLockState, Off
@FrankFang
FrankFang / Docker
Created June 22, 2020 08:52 — forked from AhianZhang/Docker
Windows Docker ToolBox使用阿里云加速
View Docker
对于已创建的Docker Machine实例,更换镜像源的方法如下
在windows命令行执行docker-machine ssh [machine-name]进入VM bash
sudo vi /var/lib/boot2docker/profile
在--label provider=virtualbox的下一行添加--registry-mirror https://xxxxxxxx.mirror.aliyuncs.com
重启docker服务:
sudo /etc/init.d/docker restart
或者重启VM:exit退出VM bash,在windows命令行中执行docker-machine restart
## 如果是新建Docker Machine实例,参考阿里云的操作文档https://cr.console.aliyun.com/#/accelerator
@FrankFang
FrankFang / next.config.js
Created May 14, 2020 18:34
next file loader // see next-images
View next.config.js
const isProd = process.env.NODE_ENV === 'production'
module.exports = {
webpack: (config, options) => {
const {isServer} = options
config.module.rules.push({
test: /\.(svg|png|jpe?g|gif)$/i,
use: isServer ? ['ignore-loader'] : [
{
loader: 'file-loader',