Skip to content

November of 2021

Computer Science

GNULinux

Git

  • New: Git stash.

    If you have uncommitted changes and you want to switch to another branch, you can temporarily save those changes with:

    git stash
    

    Then, to reapply them, do:

    git stash pop
    

PostgreSQL

  • New: Change user password.

    ALTER USER user_name WITH PASSWORD 'new_password';
    

Programming

asyncio

  • New: Limit concurrency.

    Use asyncio.Semaphore.

    sem = asyncio.Semaphore(10)
    
    async with sem:
        # work with shared resource
    

pip

  • New: Requirements files structure.

Other

  • New: Retrying library for Python.

    from tenacity import retry, stop_after_attempt, wait_exponential
    
    @retry(stop=stop_after_attempt(3), wait=wait_exponential(multiplier=0.1))
    def somefunction():
      raise Exception
    

    The function will be retried a maximum of 3 times, waiting 0.1 s, 0.2 s and 0.4 s between each attempt respectively.