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
urxvt*font: xft:terminus:pixelsize=8 | |
urxvt*boldFont: xft:terminus:pixelsize=8 | |
urxvt*termName: rxvt | |
urxvt*background: #212629 | |
urxvt*foreground: #737c80 | |
urxvt*scrollBar: false | |
urxvt*matcher.button: 1 | |
urxvt*cursorBlink: true | |
urxvt*cursorColor: #c1c8c9 | |
urxvt*colorBD: #9a7b88 |
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
from __future__ import with_statement | |
from fabric.api import local, settings, abort, sudo, cd, env | |
from fabric.context_managers import prefix | |
from fabric.contrib.console import confirm | |
code_dir = '/srv/garbagehost/garbagehost' | |
virtualenv_name = 'garbagehost' | |
env.sudo_prefix = "sudo -i -S -p '%(sudo_prompt)s' " % env |
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
[(u'["is_paid_recalculation_needed", "order_date", "order_status"]', | |
datetime.date(2013, 2, 6)), | |
(u'["_aggregate_searchable_field", "order_code", "checkout_payment_type_id"]', | |
datetime.date(2013, 2, 6)), | |
(u'["origin", "is_paid_recalculation_needed", "order_status"]', | |
datetime.date(2013, 2, 6)), | |
(u'["order_date", "order_status"]', datetime.date(2013, 2, 5)), | |
(u'["is_paid_recalculation_needed", "checkout_payment_type_id"]', | |
datetime.date(2013, 2, 5)), | |
(u'["is_paid_recalculation_needed"]', datetime.date(2013, 2, 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
[(3, datetime.date(2013, 2, 6)), | |
(2, datetime.date(2013, 2, 6)), | |
(2, datetime.date(2013, 2, 6)), | |
(3, datetime.date(2013, 2, 5)), | |
(1, datetime.date(2013, 2, 5)), | |
(1, datetime.date(2013, 2, 5)), | |
(1, datetime.date(2013, 1, 30)), | |
(1, datetime.date(2013, 1, 30)), | |
(1, datetime.date(2013, 1, 30)), | |
(1, datetime.date(2013, 1, 30)), |
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
waiting_locktype | waiting_table | waiting_query | waiting_mode | waiting_pid | other_locktype | other_table | |
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
λ:~/src/beehive/apps/products curl -XGET 'localhost:9200/products/_analyze?field=name&pretty=1' -d "\@\@Bruschetta, Ultra Thin Pizza" | |
{ | |
"tokens" : [ { | |
"token" : "\\@\\@bruschetta,", | |
"start_offset" : 0, | |
"end_offset" : 15, | |
"type" : "word", | |
"position" : 1 | |
}, { | |
"token" : "@", |
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
def get_price(self, level, when=None): | |
price_obj = self.get_price_object(level, when=None) | |
if price_obj: | |
return price_obj.price | |
else: | |
#:MC: templates are not handling error-raising attributes very well | |
#raise NoProductPriceError | |
return 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
rt = Factory.route_trip() | |
drops = rt.droppoint_set.all() | |
managers = [drop.droppointmembership_set.filter(is_drop_manager=True) | |
for drop in drops] | |
# flatten the list of managers: | |
managers = [manager for manager_list in managers for manager in manager_list] | |
credits = [manager.customer.credits.count() for manager in managers] | |
credits = reduce(lambda x, y: x + y, credits, 0) |
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
from datetime import date | |
from django.core.mail import EmailMessage, EmailMultiAlternatives | |
from django.template import Context, loader | |
snippet = Snippet.objects.get(slug='azure-incentive-program-rollout') | |
codes = { date(2013,6,25): ["Q3", "K4", "M1", "L1", "G3", "J3", "O1", "J7"] | |
, date(2013,6,26): ["K6", "K5", "G4", "N2", "K1", "N1", "J6", "I2", "D1", "F2", "C1"] | |
, date(2013,6,27): ["L2", "J4", "D3", "P1", "B1", "P2", "K2", "J5", "G1", "C2"] | |
, date(2013,6,28): ["K3", "Q1", "Q2", "I2", "L3", "D2", "G2", "F1", "J1", "J2", "C3"] | |
} |
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
reduce(lambda accum, val: dict(accum.items() + {val[0]: accum.get(val[0], 0) + val[1]}.items()), [(route.code, drop.customer_set.count()) for route in Route.objects.all() for drop in route.drop_points.filter(active=True)], {}) |