Skip to main content
Castamere
Code Aesthetic
View all authors

Zsh Alias Preview

· 4 min read ·
Castamere
Code Aesthetic

alias 用多了之后就有一个问题:敲 gco 的时候记得它是 git checkout,但 gcb 是什么来着?dcu 又是什么?通常的做法是 which gcb 看一眼再回来重敲一遍,挺打断思路的。笔者写了个 Zsh 插件,在敲命令的时候直接把 alias 展开后的内容显示在 message area,免去这一步

demo

Github SAML SSO

· 2 min read ·
Castamere
Code Aesthetic

解决 Github SAML SSO 导致无法 clone 代码的问题

Error

Cloning into 'xxx'...

remote: The 'xxx' organization has enabled or enforced SAML SSO.

remote: To access this repository, you must re-authorize the OAuth Application 'Visual Studio Code'.

fatal: unable to access 'xxx': The requested URL returned error: 403

Python's AsyncIO:A Hands-On Walkthrough

· 36 min read ·
Castamere
Code Aesthetic

Python’s asyncio library enables you to write concurrent code using the async and await keywords. The core building blocks of async I/O in Python are awaitable objects—most often coroutines—that an event loop schedules and executes asynchronously. This programming model lets you efficiently manage multiple I/O-bound tasks within a single thread of execution

In this tutorial, you’ll learn how Python asyncio works, how to define and run coroutines, and when to use asynchronous programming for better performance in applications that perform I/O-bound tasks

By the end of this tutorial, you’ll understand that:

  • Python’s asyncio provides a framework for writing single-threaded concurrent code using coroutines, event loops, and non-blocking I/O operations
  • For I/O-bound tasks, async I/O can often outperform multithreading—especially when managing a large number of concurrent tasks—because it avoids the overhead of thread management
  • You should use asyncio when your application spends significant time waiting on I/O operations, such as network requests or file access, and you want to run many of these tasks concurrently without creating extra threads or processes
important

This Article is a repost of Python's asyncio: A Hands-On WalkthroughExternal Link. Only for Chinese Translation and no commercial use. If any violation of copyright, please contact me to delete it