Skip to content

Instantly share code, notes, and snippets.

View justutiz's full-sized avatar

Justas Maziliauskas justutiz

View GitHub Profile
@justutiz
justutiz / PythonFindClosestZeroValue.py
Last active August 29, 2015 14:08
Find number closest to 0 (zero)
numbers = [2,5,8,1,5,32,6,8,-0.2,3,6,0.3,-2,-3,-8,-20]
t = []
n = []
for i in numbers:
if i > 0:
t.append(i)
else:
n.append(i)
@justutiz
justutiz / PHParrayToObject.php
Last active August 29, 2015 14:07
PHP convert array to object
json_decode(json_encode($array), FALSE);