Skip to content

Instantly share code, notes, and snippets.

@wsmoak
wsmoak / gist:c218a62c316d4b2329d4
Created February 20, 2015 23:21
Chargify - Change text for next renewal
function changeNextRenewalHtml() {
var nextRenewal = $('#next-renewal-charge');
nextRenewal.html("(then $35.00 on November 1st each year)");
};
$(document).bind("afterSummaryRefresh", changeNextRenewalHtml);
@wsmoak
wsmoak / chargify-layout.html
Created January 28, 2015 14:45
Chargify - Setting the background color for HTML email using a Layout
<html>
<body style="background: pink;">
<!-- start of email content -->
{{main_content}}
<!-- end of email content -->
</body>
</html>
@wsmoak
wsmoak / gist:b67109cdc4b46bfc9067
Created January 27, 2015 16:05
Chargify - Mark shipping country field as required
$(document).ready(function(){
var countryLabel = $('label[for="subscription_customer_attributes_country"]');
countryLabel.text("* " + countryLabel.text());
});
@wsmoak
wsmoak / gist:f8d407b19ec6e6c50a2e
Last active August 29, 2015 14:14
Chargify - Hide all shipping address fields (except country)
function hideShippingAddressFields()
{
$('#subscription_customer_attributes_address').hide();
$('#subscription_customer_attributes_address_2').hide();
$('#subscription_customer_attributes_city').hide();
$('#subscription_customer_attributes_state').hide();
{
"_id": {"$oid": "546396c27e12bd7eab000007"},
"id": "43",
"doe": "3BL",
"buck": "C16",
"birth_date": "2014-10-24 04:00:00 UTC",
"kindled": 2,
"survived": 2,
"weights": [
{
I started with
{ :weight => 2.24, :count => 2, :date => to_utc(2014,11,10), :notes => "" }
then
{ :weight => 1.14, :date => to_utc(2014,11,10), :notes => "" }
{ :weight => 1.10, :date => to_utc(2014,11,10), :notes => "" }
But I only want one "thing" for each date, with the details stored inside. I tried:
coll.insert ({"type"=>"breeding", "doe"=>"C3", "buck"=>"C4", "date"=>to_utc(2014,11,7),
"exposures" => [
{"type"=>"exposure", "date" => to_utc(2014,11,7), "notes"=>"not interested"},
{"type"=>"exposure", "date" => to_utc(2014,11,8), "notes"=>"success"}
] }
)
coll.insert({"type"=>"breeding", "doe"=>"NZW8", "buck"=>"C4", "date"=>to_utc(2014,11,7),
"exposures" => [
{"type"=>"exposure", "date" => to_utc(2014,11,7), "notes"=>"success"},
{"type"=>"exposure", "date" =>to_utc(2014,11,8), "notes"=>"very upset!"}