This file contains hidden or 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.20; | |
| /* | |
| Chainlink BTC/USD Price Feed | |
| Network: Sepolia | |
| */ | |
| interface AggregatorV3Interface { |
This file contains hidden or 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
| git config --global https.proxy http://127.0.0.1:7890 | |
| git config --global https.proxy https://127.0.0.1:7890 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import subprocess | |
| import sys | |
| # 固定代理地址 | |
| PROXY = "http://127.0.0.1:10808" | |
| def run(cmd): | |
| result = subprocess.run( |
This file contains hidden or 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
| public class CopyOnWriteHashMap<K, V> implements Map<K, V>, Cloneable { | |
| private volatile Map<K, V> internalMap = new HashMap<>(); | |
| private static final Unsafe UNSAFE; | |
| private static final long INTERNAL_MAP_OFFSET; | |
| static { | |
| try { | |
| Field theUnsafeField = Unsafe.class.getDeclaredField("theUnsafe"); | |
| theUnsafeField.setAccessible(true); | |
| UNSAFE = (Unsafe) theUnsafeField.get(null); |
This file contains hidden or 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
| class SnowflakeIdGenerator { | |
| // 起始时间戳 (2024-01-01 00:00:00) | |
| private final long START_TIMESTAMP = 1704038400000L; | |
| // 每部分占用位数 | |
| private final long SEQUENCE_BIT = 12; // 序列号占12位 | |
| private final long MACHINE_BIT = 5; // 机器ID占5位 | |
| private final long DATACENTER_BIT = 5; // 数据中心占5位 | |
| // 最大值 |
This file contains hidden or 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
| 你好,gist.github |