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 node | |
const fs = require('fs'); | |
const path = require('path'); | |
/** | |
* Recursively finds all files with a specific name in a directory. | |
* @param {string} startPath The directory to start searching from. | |
* @param {string} fileName The name of the file to find (e.g., 'go.mod'). | |
* @returns {string[]} An array of full paths to the found files. |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"crypto/ecdsa" | |
"github.com/ethereum/go-ethereum/crypto" | |
) |
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
from contextlib import contextmanager | |
import inspect | |
@contextmanager | |
def get_session_context(): | |
try: | |
print("get_session_context before") | |
yield 10 | |
print("get_session_context after") |
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
thread 'tokio-runtime-worker' panicked at 'called after complete', /home/vm/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/sync/oneshot.rs:1056:13 | |
stack backtrace: | |
0: std::panicking::begin_panic | |
at /rustc/5d8767cb229b097fedb1dd4bd9420d463c37774f/library/std/src/panicking.rs:616:12 | |
1: <tokio::sync::oneshot::Receiver<T> as core::future::future::Future>::poll | |
at /home/vm/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.15.0/src/sync/oneshot.rs:1056:13 | |
2: quinn::send_stream::SendStream::poll_finish | |
at /home/vm/.cargo/git/checkouts/quinn-b26c2db1d34f0cc5/86780c8/quinn/src/send_stream.rs:143:15 | |
3: <quinn::send_stream::SendStream as tokio::io::async_write::AsyncWrite>::poll_shutdown | |
at /home/vm/.cargo/git/checkouts/quinn-b26c2db1d34f0cc5/86780c8/quinn/src/send_stream.rs:256:9 |
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
use tokio::net::TcpStream; | |
use tokio::io::AsyncReadExt; | |
use tokio::io::AsyncWriteExt; | |
#[tokio::main] | |
async fn main() { | |
let join_handle1 = start_remote_server(); | |
let a = tokio::spawn(async move { | |
start_tokio_server().await; |