Skip to content

Instantly share code, notes, and snippets.

View daniyalzade's full-sized avatar

Eytan Daniyalzade daniyalzade

View GitHub Profile
function getDotted(data, field, def, delimeter) {
delimeter = delimeter || '.';
if (field.indexOf(delimeter) < 0) {
return data[field] || def;
}
var components = field.split(delimeter);
components = components.reverse();
while (!!components.length && (typeof(data) == 'object')) {
data = data[components.pop()]
}
@daniyalzade
daniyalzade / connection.py
Created May 23, 2012 19:47
AutoReconnectingConnection
import functools
import logging
from pymongo.errors import AutoReconnect
from pymongo import Connection
from pymongo import ReplicaSetConnection
import time
import types
def wrap(func, num_retries, sleep_interval):
@functools.wraps(func)
@daniyalzade
daniyalzade / gist:1271105
Created October 7, 2011 19:05
PyCodeConf Notes
Learn:
software transactional memory
couroutines
* http://www.dabeaz.com/coroutines/Coroutines.pdf
python 3
* Improvements to GIL
http://www.dabeaz.com/python/GIL.pdf
pypy
* Maybe getting rid of gil
* jit genarator
Learn:
software transactional memory
couroutines
* http://www.dabeaz.com/coroutines/Coroutines.pdf
python 3
* Improvements to GIL
http://www.dabeaz.com/python/GIL.pdf
pypy
* Maybe getting rid of gil
* jit genarator