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
axios.defaults.xsrfHeaderName = 'X-CSRFToken' | |
axios.defaults.xsrfCookieName = 'csrftoken' |
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
def allow_in(gateway, allowed) | |
if Input.cart.shipping_address and allowed.include?(Input.cart.shipping_address.country_code) | |
Output.payment_gateways = Input.payment_gateways | |
else | |
Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway| | |
payment_gateway.name == gateway | |
end | |
end | |
end |
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
def sort_gateways(order) | |
Output.payment_gateways = Input.payment_gateways.sort_by do |gateway| | |
# sometimes name isn't equal the title you see in payment page | |
# puts gateway.name | |
order.index(gateway.name) || 99 | |
end | |
end | |
sort_gateways([ | |
'Credit and Debit Cards', |
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
def rename_gateways(names) | |
Input.payment_gateways.each do |gateway| | |
# puts gateway.name | |
next unless names[gateway.name] | |
gateway.change_name(names[gateway.name]) | |
end | |
Output.payment_gateways = Input.payment_gateways | |
end | |
rename_gateways({ |
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
<template> | |
<div v-loading="loading"> | |
<textarea v-model="text"></textarea> | |
{{ saving ? 'saving...' : '✓' }} | |
</div> | |
</template> | |
<script> | |
export default { | |
data: () => ({ | |
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
def allow_in(gateway, eligible_country_codes) | |
if Input.cart.shipping_address and eligible_country_codes.include?(Input.cart.shipping_address.country_code) | |
Output.payment_gateways = Input.payment_gateways | |
else | |
Output.payment_gateways = Input.payment_gateways.delete_if do |payment_gateway| | |
payment_gateway.name == gateway | |
end | |
end | |
end |
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
!function () { | |
// target="_blank" for external links | |
var origin = location.host.replace(/www\./, '') | |
Array.prototype.slice.call(document.getElementsByTagName('a')) | |
.filter(function (a) { return a.host && !a.host.match(origin + '$') }) | |
.forEach(function (a) { a.setAttribute('target', '_blank') }) | |
}() |
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
import os | |
from django.core.management.base import BaseCommand | |
from django.conf import settings | |
COMMAND = f''' | |
./var/env/bin/certbot {{}} | |
--config-dir=./var/certbot/cfg | |
--work-dir=./var/certbot/work |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Put this in /etc/logrotate.d/mongodb | |
# http://stackoverflow.com/questions/5004626/mongodb-log-file-growth | |
/var/log/mongodb/*.log { | |
daily | |
rotate 30 | |
compress | |
dateext | |
missingok | |
notifempty |