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
// https://developers.google.com/analytics/devguides/collection/analyticsjs/ecommerce | |
ga('tutorTracker.require', 'ecommerce'); | |
var price = (Coach.Conversion.revenue_cents/100).toFixed(2); | |
var txID = Coach.Conversion.object.order_id.toString(); | |
ga('tutorTracker.ecommerce:addTransaction', { | |
'id': txID, | |
'affiliation': | |
'Podia Storefront', |
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
#################################################################################### | |
# Dracula themed prompt | |
# https://github.com/dracula/terminal.app/issues/2#issuecomment-254878940 | |
# Colors | |
black="\[$(tput setaf 0)\]" | |
red="\[$(tput setaf 1)\]" | |
green="\[$(tput setaf 2)\]" | |
yellow="\[$(tput setaf 3)\]" | |
blue="\[$(tput setaf 4)\]" |
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
# == Let's work with a subscription that has an existing coupon == | |
subscription = Stripe::Subscription.retrieve('sub_ABC123') | |
subscription.discount.coupon.id # => "early-upgrade" | |
# Preview invoice keeps the coupon, as expected. | |
Stripe::Invoice.upcoming( | |
customer: subscription.customer, | |
subscription: subscription.id | |
).discount.coupon.id # => "early-upgrade" |
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
$spacing-scale: ( | |
0, | |
0.3125rem, | |
0.625rem, | |
0.9375rem, | |
1.25rem, | |
1.5625rem, | |
3.125rem, | |
4.688rem, | |
6.25rem, |
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
default_app_config = 'cn.apps.users.config.UsersAppConfig' |
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
$(document).on('click', '.modal button.yes', function() { | |
console.log('You clicked yes!'); | |
$.modal.close(); | |
}); | |
$(document).on('click', '.modal button.no', function() { | |
console.log('You clicked no!'); | |
$.modal.close(); | |
}); |
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 | |
# File path should be ./bin/post_compile | |
# (.sh extension added in Gist just to enable shell syntax highlighting. | |
# https://discussion.heroku.com/t/django-automaticlly-run-syncdb-and-migrations-after-heroku-deploy-with-a-buildpack-or-otherwise/466/7 | |
echo "=> Performing database migrations..." | |
python manage.py migrate |
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
<!-- in head --> | |
<style> | |
body.clicked { | |
background: #7f1d26; | |
} | |
.smiley { | |
position: fixed; | |
top: 1rem; | |
right: 1rem; | |
width: 1rem; |
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 rest_framework_jwt.serializers import JSONWebTokenSerializer | |
from rest_framework.serializers import ValidationError | |
from rest_framework.authtoken.serializers import AuthTokenSerializer | |
from .models import LoginLockout | |
class LockableTokenSerializer(object): | |
""" | |
In addition to the normal token auth validation, |
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
// Array.forEach potentially faster than loop | |
// http://jsperf.com/testing-foreach-vs-for-loop | |
var links = document.querySelectorAll('a[href*="//' + window.location.host +'"]'); | |
[].slice.call(links).forEach(function(a) { | |
a.target = '_blank'; | |
}); |