export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ConnectorNotFoundError, | |
UserRejectedRequestError, | |
RpcError, | |
ResourceUnavailableError, | |
SwitchChainNotSupportedError, | |
} from "wagmi"; | |
import { InjectedConnector } from "wagmi/connectors/injected"; | |
import { Chain, Ethereum } from "@wagmi/core"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Author: __rodx00__ | |
* | |
* Usefull functions while reversing frida scripts. | |
*/ | |
function bin2ascii(array) { | |
var result = []; |
# shell 载入
if [[ "~/opt/miniconda3" ]]; then
export PATH=$PATH:~/opt/miniconda3/bin
fi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const App = () => { | |
const device = useDevice(); | |
return <div className={getClassName(device)}> | |
Test | |
</div> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCookies } from "react-cookie"; | |
import { Tab, TabList, TabPanel, Tabs } from "react-tabs"; | |
import styles from "./style.module.css"; | |
import { useLocale } from "@/locales/i18n"; | |
const App = () => { | |
// 这里获取 intl | |
const __ = useLocale(); | |
return <div> |
docker run -d --name clickhouse-server --ulimit nofile=262144:262144 -p 8123:8123 -p 9000:9000 -p 9009:9009 --privileged=true -v ~/db/clickhouse/log:/var/log/clickhouse-server -v ~/db/clickhouse/data:/var/lib/clickhouse clickhouse/clickhouse-server:22.1.4.30
然后 http://localhost:8123
验证.
使用客户端:
> docker exec -it clickhouse-server /bin/bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useDialog } from "@/components/dialog/index"; | |
import DialogTitle from "@material-ui/core/DialogTitle"; | |
const App = () => { | |
const [openDialog, closeDialog] = useDialog(); | |
return <button | |
href="#!" | |
onClick={() => { | |
openDialog({ |
高阶组件:接收函数作为输入,或者输出另一个函数的一类函数,被称作高阶函数。对于高阶组件,它描述的便是接受React组件作为输入,输出一个新的React组件的组件。即高阶组件通过包裹(wrapped)被传入的React组件,经过一系列处理,最终返回一个相对增强(enhanced)的React组件,供其他组件调用。
什么时候使用高阶组件:在React开发过程中,发现有很多情况下,组件需要被"增强",比如说给组件添加或者修改一些特定的props,一些权限的管理,或者一些其他的优化之类的。而如果这个功能是针对多个组件的,同时每一个组件都写一套相同的代码,明显显得不是很明智,所以就可以考虑使用HOC。
react-redux 的 connect 方法就是一个 HOC ,他获取 wrappedComponent ,在 connect 中给 wrappedComponent 添加需要的 props。
// define
我已经习惯使用 IDEA 写 Java,所以在 VSCode 里写 Typescript 也想要 rename 、go to defined 这些功能。这些功能在最开始写 JavaScript 的时候还真的没用过,每次都是全局搜索,很 low ~
基本参考这篇文章 https://johnpapa.net/refactoring-with-visual-studio-code/ 然后按照自己的习惯改改快捷键就行了。
常用功能有(快捷键是我自己设置的):
- format: cmd + shift + l
NewerOlder