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_holidays(year=date.year): | |
easter_sunday = easter.easter(year) | |
holidays = [ | |
# These holidays have a fixed date | |
date(year,1,1), # New Year | |
date(year,5,1), # Labor Day | |
date(year,6,5), # Constitution Day (Grundlovsdag) | |
date(year,12,24), # Christmas Night | |
date(year,12,25), # 1st Christmas Day | |
date(year,12,26),# 2st Christmas Day |
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 friendly_signature_line(): | |
i = datetime.now() | |
day_num_in_week = int(i.strftime("%w")) | |
month_num = int(i.strftime("%m")) | |
day_num_in_month = int(i.strftime("%d")) | |
hour_num = int(i.strftime("%H")) | |
if month_num == 12 and day_num_in_month > 12 and day_num_in_month < 26: | |
return _("We wish you Merry Christmas & Happy New Year") |
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 django import forms | |
from oscar.core.loading import get_model | |
from django.utils.translation import ugettext_lazy as _ | |
Reminder = get_model('reminder', 'Reminder') | |
class ReminderForm(forms.ModelForm): | |
def __init__(self, user, *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
<?php | |
// MIchael Hjulskov | |
class AdminOrdersController extends AdminOrdersControllerCore | |
{ | |
public function __construct() | |
{ | |
parent::__construct(); |
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
<?php | |
class FrontController extends FrontControllerCore | |
{ | |
public function getRedirectAuthenticationURL(){ | |
$http = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='Off' && !empty($_SERVER['HTTPS'])) ? "https://" : "http://"); | |
if ($_SERVER['QUERY_STRING']){ // example=1&example2=2 | |
return urlencode($http.$_SERVER["HTTP_HOST"].$_SERVER['REQUEST_URI']); | |
} else { | |
return ($this->authRedirection ? $this->authRedirection : ''); | |
} |
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
<?php | |
/** | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Software License Agreement | |
* that is bundled with this package in the file LICENSE.txt. | |
* | |
* @author Michael Hjulskov | |
* @copyright 2014-2015 Michael Hjulskov | |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.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
<?php | |
/* | |
* 2013 Ha!*!*y | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Academic Free License (AFL 3.0) | |
* It is available through the world-wide-web at this URL: | |
* http://opensource.org/licenses/afl-3.0.php | |
* |
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
<?php | |
/* Michael Hjulskov | |
*/ | |
class OrderConfirmationController extends OrderConfirmationControllerCore | |
{ | |
public function initContent() | |
{ | |
parent::initContent(); | |
$order = new Order($this->id_order); |
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
{* Michael Hjulskov Bing Ads conversion tracking *} | |
{literal} | |
<script data-keepinline="true">(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"4039111"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");</script><noscript><img src="//bat.bing.com/action/0?ti=4039111&Ver=2" height="0" width="0" style="display:none; visibility: hidden;" /></noscript> | |
<script data-keepinline="true"> window.uetq = window.uetq || []; | |
window.uetq.push({ 'gv': {/literal}{$total_paid|escape:'htmlall':'UTF-8'}{literal} }); | |
</script> | |
{/literal} | |
{* END Michael Hjulskov Bing Ads conversion tracking *} |
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
<?php | |
// Michael Hjulskov - added this to fix issue with Google Adwords conversion tracking code | |
// REMEMBER TO ADD data-keepinline="true" to the order-confirmation.tpl to avoid javascript to get broken | |
Class Media extends MediaCore | |
{ | |
public static function deferScript($matches) | |
{ | |
if (!is_array($matches)) |
OlderNewer