• yaml multilines

    # Multiple-line strings can be written either as a 'literal block' (using |), 
    # or a 'folded block' (using '>').
    # Literal block turn every newline within the string into a literal newline (\n).
    # Folded block removes newlines within the string.
    literal_block: |
      This entire block of text will be the value of the 'literal_block' key,
      with line breaks being preserved.
    
      The literal continues until de-dented, and the leading indentation is
      stripped.
    
          Any lines that are 'more-indented' keep the rest of their indentation -
          these lines will be indented by 4 spaces.
    folded_style: >
      This entire block of text will be the value of 'folded_style', but this
      time, all newlines will be replaced with a single space.
    
      Blank lines, like above, are converted to a newline character.
    
          'More-indented' lines keep their newlines, too -
          this text will appear over two lines.
    
    # |- and >- removes the trailing blank lines (also called literal/block "strip")
    literal_strip: |-
      This entire block of text will be the value of the 'literal_block' key,
      with trailing blank line being stripped.
    block_strip: >-
      This entire block of text will be the value of 'folded_style', but this
      time, all newlines will be replaced with a single space and 
      trailing blank line being stripped.
    
    # |+ and >+ keeps trailing blank lines (also called literal/block "keep")
    literal_keep: |+
      This entire block of text will be the value of the 'literal_block' key,
      with trailing blank line being kept.
    
    block_keep: >+
      This entire block of text will be the value of 'folded_style', but this
      time, all newlines will be replaced with a single space and 
      trailing blank line being kept.
    
  • WORDCHARS

    export WORDCHARS=’-_’

  • copilot太棒了

    VIM 上面有好多好用的插件,各有所长。但说到最棒的插件,还是copilot,智能补全太厉害了。

  • 一年一度喜剧大赛

    实在是太好笑了。刚刚看了重逢主题的两个喜剧,又看了一下大猩猩进化的,他们的想象力太赞了,惊人的想象力。

  • OBJC_DISABLE_INITIALIZE_FORK_SAFETY

    在运行一些 Python 应用时,遇到下面这个错误。

    objc[12297]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
    

    解决:

    export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
    
  • what is $$

    From Advanced Bash-Scripting Guide:

    $$ is the process ID (PID) of the script itself.

    $BASHPID is the process ID of the current instance of Bash. This is not the same as the $$ variable, but it often gives the same result.

  • 抽筋了

    踢完球,晚上睡觉抽筋有感。

    不爱可以,没啥,不爱就不爱。但请不要不爱还说爱。

  • Hung Up Quickly

    前天从苏州团建回来,晚上给赛赛拨视频。他正在看电视,也不正眼看我,姥姥让他说啥,他就复述一下。我说你看电视吧,然后他火速把视频给挂了~ :)

  • 团建归来

    苏州团建,自驾,30人左右,周四出发,周六下午回来。周经理安排的很妥当,自己就完全不用操心。完美。

    民宿也不错,空间挺大,10个人狼人杀,七八个人德州,中间还有人可以打桌球。

    中间还吃了日料~

  • Lazy Log In Python

    import logging
    
    
    def bad_call_with_problem():
        try:
            logging.error("haha %d" % None)
        except:
            print("Raised an error.")
            raise
        print("-" * 10)
    
    
    def good_call_with_problem():
        try:
            logging.error("haha %d", None)
        except:
            print("This will never be raised.")
            raise
        print("~" * 10)
    
    
    good_call_with_problem()
    bad_call_with_problem()
    good_call_with_problem()
    

    专有名词叫 lazy logging,但我没有在官网找到这一块的说明,看到两篇文章如下

    https://medium.com/swlh/why-it-matters-how-you-log-in-python-1a1085851205

    https://medium.com/flowe-ita/logging-should-be-lazy-bc6ac9816906