Skip to content

Instantly share code, notes, and snippets.

@emilian
emilian / send_mailgun_attachments.py
Created November 17, 2015 19:19 — forked from adamlj/send_mailgun_attachments.py
MailGun API Python Requests multiple Attachments Send mail with multiple files/attachments with custom file names
requests.post("https://api.mailgun.net/v2/DOMAIN/messages",
auth=("api", "key-SECRET"),
files={
"attachment[0]": ("FileName1.ext", open(FILE_PATH_1, 'rb')),
"attachment[1]": ("FileName2.ext", open(FILE_PATH_2, 'rb'))
},
data={"from": "FROM_EMAIL",
"to": [TO_EMAIL],
"subject": SUBJECT,
"html": HTML_CONTENT
@emilian
emilian / gist:1344876
Created November 7, 2011 13:04
force the same address for both shipping and billing
<script type="text/javascript">
$('#CheckoutStepShippingAddress').remove();
$(document).ready(function(){
$('.ExpressCheckoutContent').ajaxSuccess(function(){
$('#BillingAddressTypeNew').parent().hide();
$('#ship_to_billing_existing').attr('checked','checked');
$('#ship_to_billing_existing').parent().hide();
$('#ship_to_billing_new').attr('checked','checked');
$('#ship_to_billing_new').parent().hide();
$('.billingButton').attr('value','Proceed');
@emilian
emilian / gist:1333377
Created November 2, 2011 10:47
Product Page Price Calculator
<script type="text/javascript">
//<![CDATA[
var price = "%%GLOBAL_ProductPrice%%";
price = price.replace("$","");
price = price.replace(",","");
var pricei = parseInt(price);
var qty = $('#qty_').val();
var qtyi = parseFloat(qty);
var qtis = 0;
@emilian
emilian / gist:1310244
Created October 24, 2011 20:53
Category highlight
<script type="text/javascript">
var activeCategory = $("#CategoryHeading div h2").text();
$('.SideCategoryListClassic ul li a').each(function() {
if($(this).text()== activeCategory) {
$(this).css('background-color','#aaa');
}
});
</script>
@emilian
emilian / gist:1310090
Created October 24, 2011 20:28
Category
<script type="text/javascript">
var activeCategory = $("#CategoryHeading div h2").text();
$('.SideCategoryListClassic ul li a').each(function() {
if($(this).text()== activeCategory) {
$(this).css('background-color','#aaa');
}
});