This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
data: { | |
products: [ | |
{ | |
seo_title: "for_all_mankind_gwenevere_low-rise", | |
category_id: 237, | |
title: "7 for all mankind Gwenevere low-rise skinny jeans", | |
url: "http://www.net-a-porter.com/product/196792", | |
display_price: "$205", | |
price: "205", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Script to enure that the cluster defined by the hostgroup, or list | |
# hosts has enough healthy nodes as defined by the 'check_ping' plugin. | |
# If it has more than N number of unhealthy nodes, the plugin returns | |
# the appropriate error. | |
# | |
# To get the list of hosts from a hostgroup, this script parses nagios' | |
# hosts.cfg file which has the following format: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
def _display_msg(msg, use_print=False): | |
""" | |
@param msg: str | |
@param use_print: bool | |
""" | |
if use_print: | |
print msg | |
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MySQL get number of rows per table | |
select TABLE_NAME, TABLE_ROWS, DATA_LENGTH from INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'db_name'; | |
# Delete vim files | |
rm -rf ls -l **/.*.swp | |
# Find large ( 100MB > ) files | |
sudo find / -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getURLParameter(name) { | |
var val = (RegExp('[?|&]' + name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]; | |
return val ? decodeURI(val) : val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
states = { | |
'AK': 'Alaska', | |
'AL': 'Alabama', | |
'AR': 'Arkansas', | |
'AS': 'American Samoa', | |
'AZ': 'Arizona', | |
'CA': 'California', | |
'CO': 'Colorado', | |
'CT': 'Connecticut', | |
'DC': 'District of Columbia', |
OlderNewer