Skip to content

Instantly share code, notes, and snippets.

@riskers
riskers / ClickHouse.md
Last active December 9, 2023 17:29
Installing development software by Docker and brew
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
@riskers
riskers / default.custom.yaml
Last active November 25, 2023 12:50
rime config
# Rime default settings
# encoding: utf-8
patch:
config_version: "1.6"
schema_list:
- schema: luna_pinyin_simp
switcher:
caption: 〔方案選單〕
@riskers
riskers / README.md
Last active October 15, 2023 06:12
Python 环境管理 - conda
@riskers
riskers / app.tsx
Last active August 12, 2023 20:27
make material-ui dialog component imperative by react context hook
import { useDialog } from "@/components/dialog/index";
import DialogTitle from "@material-ui/core/DialogTitle";
const App = () => {
const [openDialog, closeDialog] = useDialog();
return <button
href="#!"
onClick={() => {
openDialog({
@riskers
riskers / BinanceWallet.ts
Created May 5, 2023 14:51 — forked from jeftarmascarenhas/BinanceWallet.ts
Connector to Binance on Wagmi
import {
ConnectorNotFoundError,
UserRejectedRequestError,
RpcError,
ResourceUnavailableError,
SwitchChainNotSupportedError,
} from "wagmi";
import { InjectedConnector } from "wagmi/connectors/injected";
import { Chain, Ethereum } from "@wagmi/core";
@riskers
riskers / fridaUtils.js
Created March 3, 2023 09:52 — forked from rodnt/fridaUtils.js
Bytes to hex, string to bytes, bytes to string
/**
*
* Author: __rodx00__
*
* Usefull functions while reversing frida scripts.
*/
function bin2ascii(array) {
var result = [];
@riskers
riskers / 0-main.md
Last active November 21, 2022 09:32
javascript 函数式编程

我眼中的函数式

函数式是一种编程范式,面向对象也是一种编程范式。

函数式分为两类,Lisp 和 Haskell,Lisp又有很多方言,Clojure、Scheme 都是其中一种。

JS 函数式

JavaScript 这个语言是基于原型的,可以用构造函数的方法去写 OOP,也可以去写函数式。

@riskers
riskers / throttle & debounce.md
Last active October 19, 2022 09:40
throttle and debounce
  • throttle 定义了一个函数一段时间内的最多执行次数,比如『执行这个函数最多每100ms执行一次』
  • debounce 定义了一个函数在一定时间过去也没有被调用。比如『执行这个函数在没有被调用的100ms之后』

var throttle = function(fn, delay){
    var last = 0

    return function() {
@riskers
riskers / .tmux.conf
Last active February 9, 2022 07:27
tmux 配置、快捷键
# unbind some default keybindings
unbind C-b
# set prefix key to ctrl-q
set -g prefix C-q
# lower command delay
set -sg escape-time 1
# start first window and pane at 1, not zero
@riskers
riskers / README.md
Last active January 17, 2022 09:11
Nodejs 环境管理 - nvm

nvm

添加镜像

export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node

config