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
0xFd63f136403252270fC4aCD1be21b8078aE59E25 |
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 requests | |
from django.core.management import setup_environ | |
from ymcproject import settings | |
setup_environ(settings) | |
import simplejson as json | |
from experiments import models | |
def _get_dict_for_one_page_of_products(page): | |
response = requests.get("http://lcboapi.com/products?per_page=100&page=%d" % page) | |
lcbo_data = json.loads(response.content) |
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
""" | |
Outputs a week by week commit log with one line commit messages for your entire git repository | |
from start to finish | |
""" | |
import commands | |
import datetime | |
status, start_date = commands.getstatusoutput("git log --date=short --format='%cd' --reverse | head -1") | |
status, end_date = commands.getstatusoutput("git log --date=short --format='%cd' -1") |
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
class Node(object): | |
""" | |
Tree node: left and right child + data which can be any object | |
""" | |
def __init__(self, data): | |
""" | |
Node Constructor | |
@param data node data object | |
""" | |
self.left = None |
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
View.TruncationView = Backbone.Marionette.View.extend({ | |
limit: 3, | |
events: { | |
'click .btn_less': 'truncateClicked', | |
'click .btn_more': 'unTruncateClicked' | |
}, | |
truncateClicked: function(e){ |