Skip to content

Instantly share code, notes, and snippets.

@nitroluke
nitroluke / keybase.md
Created Jul 13, 2018
keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am nitroluke on github.
  • I am nitroluke (https://keybase.io/nitroluke) on keybase.
  • I have a public key ASCFtsfwGLwPuUgoIiWsbDnHt4H8WdmqpIxYaoNyh9h7Awo

To claim this, I am signing this object:

@nitroluke
nitroluke / powersOfTwo.py
Last active Mar 23, 2016
Round up to the nearest power of 2.
View powersOfTwo.py
def nearesetPow2(x):
x = x - 1
for i in [1, 2, 4, 8, 16, 32]:
x = x | (x >> i)
return x + 1