First one gives your an array of 7 days with bits in them, each bit represents an hours in the day.
So if you're working only 0am, it'll look like this for that specific day:
000000000000000000000001
Converted to decimal, it's 1
Shift left one and it becomes: 000000000000000000000010
000000000000000000000010
OR
000000000000000000000001
=
000000000000000000000011
If you're working 0am to 5am, it'll look like this:
000000000000000000111111
Converted to decimal, it's 63
So if you're working 3 days of the week from 0am to 5am, it'll look like this:
[0, 0, 0, 63, 63, 63, 0]
Bit shifting is a convenient way to package data inside an integer in a very a efficient manner.
The second one checks if that shift is taken by seeing if bits clash when and-ing them, bits that are the same when doing a bitwise and becomes 1 and all other bits become 0. So in this example shift 23h is already taken:
010000000000000000000010
AND
010000000000000000000000
=
010000000000000000000000
So in other words, to check if shift 23h is taken, simply AND the person's shift-roster with 2^23 or 010000000000000000000000b and if you get back exactly 2^23, it's taken, otherwise if you get back 0, it's available.
These binary numbers are effectively powers of two, 0h would be 2^0, 23h would be 2^23
Hope it helps.