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
diff --git a/emails/sale-confirmation-html.html b/emails/sale-confirmation-html.html | |
index 4a0ba5c..dfac4cb 100644 | |
--- a/emails/sale-confirmation-html.html | |
+++ b/emails/sale-confirmation-html.html | |
@@ -8,6 +8,94 @@ | |
{% endblock %} | |
</head> | |
<body> | |
+ {% block json_ld %} | |
+ <script type="application/ld+json"> |
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
# -*- coding: utf-8 -*- | |
""" | |
unicode_dict_reader | |
:copyright: (C) 2013-2015 by Openlabs Technologies & Consulting (P) Limited | |
:license: BSD, see LICENSE for more details. | |
""" | |
import csv | |
class UnicodeDictReader(csv.DictReader): | |
def __init__(self, csvfile, *args, **kwargs): |
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
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<polymer-element name="my-element"> |
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
# Given a date find the monday and friday of the week | |
# This assumes that the week starts on sunday | |
import datetime | |
import calendar | |
from dateutil.relativedelta import relativedelta | |
def get_monday_in_week(date): | |
# Find the current week | |
current_week = date.isocalendar()[1] | |
delta = relativedelta(weeks=current_week-1, weekday=calendar.MONDAY) |
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
# -*- coding: utf-8 -*- | |
import os | |
import psycopg2 | |
# Connect to tryton database with database uri. | |
# | |
# Example: postgres://tryton:tryton@localhost/production | |
conn = psycopg2.connect(os.environ.get('TRYTOND_DATABASE_URI')) | |
conn.set_client_encoding('UTF8') |
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 bash | |
# This script assumes that ImageMagick is installed and the convert command is accessible via the $PATH variable | |
# Ensure that one argument has been passed in. | |
if [ ! "$#" -eq 1 ] | |
then | |
echo -e "This script requires one argument.\\ne.g. iOS_icon_maker.sh app_icon.png" | |
exit 1 | |
fi |
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 | |
# -*- coding: utf-8 -*- | |
#This file is part of Tryton. The COPYRIGHT file at the top level of | |
#this repository contains the full copyright notices and license terms. | |
import unittest | |
import threading | |
from functools import partial | |
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT, \ | |
install_module |
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 StringField(BaseField): | |
"""A unicode string field. | |
""" | |
def __init__(self, regex=None, max_length=None, min_length=None, **kwargs): | |
self.regex = re.compile(regex) if regex else None | |
self.max_length = max_length | |
self.min_length = min_length | |
super(StringField, self).__init__(**kwargs) |
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 drawVisualization() { | |
var data = new google.visualization.DataTable(); | |
data.addRows(6); | |
data.addColumn('string', 'State'); | |
data.addColumn('number', 'Customers'); | |
data.setValue(0, 0, 'US-FL'); | |
data.setValue(0, 1, 200); | |
data.setValue(1, 0, 'US-MN'); | |
data.setValue(1, 1, 300); | |
data.setValue(2, 0, 'US-NJ'); |
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
find . -mindepth 1 -maxdepth 1 -type d -exec sh -c "cd \"{}\" && python setup.py install" \; |