Skip to content

Instantly share code, notes, and snippets.

View yunyu950908's full-sized avatar
Verified

liyu yunyu950908

Verified
View GitHub Profile
@yunyu950908
yunyu950908 / tokenPriceApi.js
Created April 20, 2025 18:46 — forked from Linch1/tokenPriceApi.js
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js
@yunyu950908
yunyu950908 / RealizedPrice.pine
Created April 8, 2025 14:10
Realized Price Oscillator [InvestorUnknown]
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © InvestorUnknown | TRW: @Andrej S.
// {||}
// , {||}
// ,,,,, {||}
// ,,,,, , ,, {||}
// , ,,,, , ,, ,,, {||}
// . , , ,,,, , ,,,, .,, {||} ╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗
// ,, , ,, ,,,,,,, , , , {||} ╠╬╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╬╣
//

user: 有哪些常用的密钥分片算法

cloud-gpt-4o: 密钥分片算法是一种将密钥分成多个部分(分片)的方法,其中每一部分单独保存或分发,只有当足够数量的分片组合在一起时,才能还原出密钥本身。这种技术广泛用于分布式存储和安全机制,以防止单点故障或密钥泄露。以下是一些常用的密钥分片算法:


1. Shamir’s Secret Sharing(沙米尔秘密共享算法)

  • 核心思想: Shamir’s Secret Sharing 基于数学中的多项式插值和有限域算术。一个密钥被作为多项式在 (x=0) 处的值,而多个分片则由该多项式的其他点值生成。通过拉格朗日插值法,当至少获取 (k) 个分片时,可以重建出原始密钥。
  • 特点
你长的怪像人殊不知是只人面犬
你的脸有碍观瞻
当初惊艳,完完全全,只为世面见得少。
嫉妒是一种不好的情感,我理解你嫉妒我有家人,可你这么说有点过分了
你自拍一张就是你的全家福
远看是美景,近看想报警
你在无中生有 你在暗度陈仓 你在凭空想象 你在凭空捏造 你在无言无语 你在无可救药 你是逝者安息 你是一路走好 你是傻子巴拉 你是永无止境 你是没钱买药 你是头脑有病 你是眼里有泡 你是嘴里刘能 你是污言秽语 你是咎由自取 你是殃及无辜 你是祸害众生 你是仓皇失措 你是暗度陈仓 你是无可救药
胖姑娘袭花衫,花都胖起来。
即使是做咸鱼,也要做最咸的那一条。
@yunyu950908
yunyu950908 / add_to_zshrc.sh
Created October 31, 2024 02:57 — forked from karpathy/add_to_zshrc.sh
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@yunyu950908
yunyu950908 / open_graph.md
Last active September 14, 2024 08:14
Open Graph 协议

https://devv.ai/search?threadId=dxuu72syxse8

Open Graph 协议是一种网络协议,最初由 Facebook 在 2010 年创建,旨在标准化网页中元数据的使用,以便更好地表示页面内容12。这个协议允许任何网页成为社交图谱中的丰富对象,使得网站内容在社交媒体平台上能够以更吸引人的方式呈现14

Open Graph 协议的主要目的是:

  1. 提高网页在社交媒体上的分享效果
  2. 让网站管理员能够控制他们的内容在社交平台上的展示方式
  3. 为社交媒体平台提供结构化的数据,以便更好地理解和展示网页内容
@yunyu950908
yunyu950908 / biaori-to-anki.js
Created January 9, 2020 18:04 — forked from breezewish/biaori-to-anki.js
将新标准日语初级和中级的音频和单词导入到 anki https://ankiweb.net/shared/info/1939635284
const child_process = require('child_process');
const path = require('path');
const glob = require('glob');
const crypto = require('crypto');
const fs = require('fs-extra');
const _ = require('lodash');
const id3 = require('node-id3');
const sort = require('alphanum-sort');
const extractAudio = false;
@yunyu950908
yunyu950908 / tmux-cheatsheet.markdown
Created July 15, 2019 01:57 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@yunyu950908
yunyu950908 / git-tag-delete-local-and-remote.sh
Created July 5, 2019 15:27 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@yunyu950908
yunyu950908 / launcher.sh
Created March 28, 2019 03:57
launcher.sh with args
#/bin/bash
package="dev-launcher"
app="*"
page="*"
while test $# -gt 0; do
case "$1" in
-h|--help)