Skip to content

Instantly share code, notes, and snippets.

View TimNZ's full-sized avatar

Tim Shnaider TimNZ

View GitHub Profile
@TimNZ
TimNZ / cocart-node.js
Last active April 8, 2020 22:22
Testing simultaneous guest user cart management of CoCart, ensuring each session is separate
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 October 12, 2021 15:20
Custom PaginationComponent for React Table when it is not practical to know total # of pages
/**
* 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}
@TimNZ
TimNZ / marionette.gauntlet.js
Last active December 12, 2015 05:28 — forked from mxriverlynn/marionette.gauntlet.js
Various enhancements
// 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
//