Skip to content

Instantly share code, notes, and snippets.

View BenSeward's full-sized avatar

Ben Seward BenSeward

View GitHub Profile
@BenSeward
BenSeward / DeliveryOptions.json
Last active December 1, 2022 10:27
Dummy Delivery Options
{
"options": [
{
"id": "562675f3-8675-4ba9-82ff-3aa9a3ef3d28",
"name": "Fedex Delivery",
"label": "Delivery within 2-3 working days",
"price": 0
},
{
"id": "5a4f7a44-f82a-4e13-92d9-03b7494480b2",
provider:
name: aws
runtime: nodejs12.x
environment:
USER_TABLE: ${self:service}-${opt-stage, self:provider.stage}
USER_EMAIL_TABLE: "user-email-${opt:stage, self:provider.stage}"
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
// Cookie banner that expires after 10 days
if (/(^|;)\s*visited=/.test(document.cookie)) {
$j('.cookie-banner').hide();
} else {
// 60 seconds to a minute, 60 minutes to an hour, 24 hours to a day, and 10 days.
document.cookie = "visited=true; max-age=" + 60 * 60 * 24 * 10;
$j('#accept-cookies').on('click', function() {
$j('.cookie-banner').hide();
});
@BenSeward
BenSeward / AJAX
Last active August 22, 2016 21:17
<script>
$(document).ready(function(){
$('#account-update').on('submit', function(e) {
e.preventDefault();
var formData = new FormData();
// other inputs
//append some non-form data also
formData.append('name',$('input[name=name]').val()),