This file contains hidden or 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 datetime | |
from dateutil.relativedelta import relativedelta | |
from django.template import Library | |
from django.template import Node, TemplateSyntaxError | |
from django.utils.timezone import get_current_timezone | |
from django.template.defaultfilters import date | |
from django.conf import settings | |
register = Library() |
This file contains hidden or 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
elm.bind('paste', function(e) { | |
//console.log(e); | |
e.preventDefault(); | |
var text = (e.originalEvent || e).clipboardData.getData("text/html"); | |
if (!text){ | |
console.log('no html'); | |
text = (e.originalEvent || e).clipboardData.getData("text/plain"); | |
} | |
var temp = $('<div />'); | |
$(temp).html(text); |
This file contains hidden or 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
{% block preloader %} | |
{% if user.is_authenticated %} | |
<div data-ng-if="showPreloader"> | |
{% assign name="loadingText" %}{% trans "Loading..." %}{% endassign %} | |
{% include 'inc/preloader.html' %} | |
</div> | |
{% endif %} | |
{% endblock %} |
This file contains hidden or 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
#!/bin/bash | |
git pull | |
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install -r requirements.txt | |
./manage.py migrate | |
sh ./scripts/bind_solr.sh | |
./manage.py rebuild_index --noinput |
This file contains hidden or 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
/* jslint browser: true, undef: true, newcap: true, forin: true, sub: true, white: true, indent: 4, unused: false */ | |
/* globals define: true */ | |
define( | |
[ | |
'angularAMD', | |
'angular-mm-foundation', | |
'selectize-ng' | |
], function (angularAMD) { | |
$.noConflict(); |
This file contains hidden or 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
var gulp = require('gulp'); | |
var compass = require('gulp-compass'); | |
var path = require('path'); | |
var paths = { | |
styles: { | |
src: 'nutrimom/static/scss/*', | |
dest: 'nutrimom/static/.sass-cache' | |
} | |
}; |
This file contains hidden or 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 -*- | |
from django.conf import settings | |
from django.core.mail import EmailMessage | |
def zendesk_ticket(subject, form, request, form_type='email'): | |
email = form.cleaned_data['email'] | |
if form_type == 'email': | |
message = """ | |
Email: %s |
This file contains hidden or 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 TransactionsList(ListAPIView): | |
""" | |
List all transactions for currently logged in user, paginated by 25 | |
page -- page number | |
ordering -- yoddle_amount, created, yoddle_description, reverse order ie. -yoddle_amount | |
""" | |
model = Transaction |
This file contains hidden or 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
// using jQuery | |
function getCookie(name) { | |
var cookieValue = null; | |
if (document.cookie && document.cookie != '') { | |
var cookies = document.cookie.split(';'); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = jQuery.trim(cookies[i]); | |
// Does this cookie string begin with the name we want? | |
if (cookie.substring(0, name.length + 1) == (name + '=')) { | |
cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); |
This file contains hidden or 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
AnimatedTransitionRegion = Backbone.Marionette.Region.extend({ | |
show: function(view){ | |
this.ensureEl(); | |
view.render(); | |
this.close(function() { | |
if (this.currentView && this.currentView !== view) { return; } | |
this.currentView = view; | |
this.open(view, function(){ |