Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Dayjo's full-sized avatar

Joel Dayjo

View GitHub Profile
@Dayjo
Dayjo / gocardless-events.md
Created November 19, 2015 11:29
gocardless events

Mandate actions

created

The mandate has been created.

submitted

The mandate has been submitted to the banks, and should become active in a few days, unless the bank declines the request.

active

The mandate has been successfully set up by the customer's bank.

@Dayjo
Dayjo / _link.md
Last active November 18, 2015 09:01
Proposal for adding _link to API resources
@Dayjo
Dayjo / bling.js
Last active August 29, 2015 14:23 — forked from paulirish/bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document)
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn)
}
NodeList.prototype.__proto__ = Array.prototype
@Dayjo
Dayjo / invoices.php
Last active August 29, 2015 14:18
Script to update subscription vat rates based on last invoice
<?php
// Get everyone's "last subscription invoice" for people who've paid in the last year
$sql = "SELECT i1.vatrate, i1.username
FROM invoices i1
LEFT JOIN invoices i2 ON (i1.username = i2.username AND i1.id < i2.id)
WHERE i2.id IS NULL
AND i1.datestamp > '2014-04-01'
AND i1.type IN ('sub','subpayment','upgrade','resubscription')
ORDER BY i1.vatrate DESC";
@Dayjo
Dayjo / discount-tax.md
Last active August 29, 2015 14:14
User Stories for Discount and Tax

Exclusive of VAT

Scenario 1

  • Product prices are Exclusive of VAT
  • No Discount Code
  • Cart Contains
  • 1 x ProductA £10.00 (20% VAT)
  • 1 x ProductB £10.00 (15% VAT)
  • test
  1. item 4
  2. item one
  3. item three
  4. item two
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
@Dayjo
Dayjo / related_products.inc.php
Created July 28, 2014 14:41
shopsale banner