rem’s avatarrem’s Twitter Archive—№ 68,993

  1. I feel like I've overcomplicated the return statement. Any suggestions?
    oh my god twitter doesn’t include alt text from images in their API
    1. …in reply to @rem
      The corrected code (to get a slice of bits from a byte) is: const mask = 2 ** length - 1; const shift = 8 - (ptr + length); return (value & (mask << shift)) >> shift;
    2. …in reply to @rem
      Okay, this function is actually incorrect. It works at times, but not others. Darnit.