Skip to content

Instantly share code, notes, and snippets.

Avatar

Tim Shnaider TimNZ

View GitHub Profile
@TimNZ
TimNZ / cocart-node.js
Last active Apr 8, 2020
Testing simultaneous guest user cart management of CoCart, ensuring each session is separate
View cocart-node.js
const axios = require("axios").default
const axiosCookieJarSupport = require("axios-cookiejar-support").default
const CookieJar = require("tough-cookie").CookieJar
const assert = require('assert')
let instanceId = 1
const createAxiosInstance = () => {
const axiosInstance = axios.create({
baseURL: "https://test.site/wp-json/cocart/v1",
withCredentials: true,
})
@TimNZ
TimNZ / PaginationComponent.js
Last active Apr 13, 2020
Custom PaginationComponent for React Table when it is not practical to know total # of pages
View PaginationComponent.js
/**
* Override React Table pagination component to be able to control Previous/Next
*/
import React, { Component } from 'react'
import classnames from 'classnames'
const defaultButton = props => (
<button type="button" {...props} className="-btn">
{props.children}
View marionette.gauntlet.js
// Marionette.Gauntlet v0.0.0
// --------------------------
//
// Build wizard-style workflows with an event-emitting state machine
// Requires Backbone.Picky (http://github.com/derickbailey/backbone.picky)
//
// Copyright (C) 2012 Muted Solutions, LLC.
// Distributed under MIT license
// Modifications by Tim Shnaider
//