Skip to content

Instantly share code, notes, and snippets.

Avatar

Justas Maziliauskas justutiz

View GitHub Profile
@justutiz
justutiz / PythonFindClosestZeroValue.py
Last active Aug 29, 2015
Find number closest to 0 (zero)
View PythonFindClosestZeroValue.py
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 Aug 29, 2015
PHP convert array to object
View PHParrayToObject.php
json_decode(json_encode($array), FALSE);
You can’t perform that action at this time.