Skip to content

Instantly share code, notes, and snippets.

View sohara's full-sized avatar

Sean O'Hara sohara

View GitHub Profile
@sohara
sohara / example.js
Last active March 26, 2021 14:56
Register Placements example
window.BreadPayments.setup({
integrationKey: 'xxx-xxx-xxx',
rtpsId: 'xxx - xxx - xxxx',
loyaltyID: 'xxxxxx',
buyer: {
givenName: 'Jack',
familyName: 'Seamus',
additionalName: 'C.',
birthDate: '1974-08-21',
email: 'johncseamus@gmail.com',
@sohara
sohara / sdk.js
Last active January 27, 2021 16:54
SDK scratchpad
SDK.setup({
placements: [
{
financingType: "installments" /* card | installments */,
locationType: "product" /* product | cart | checkout */,
domID: "myDomElement" /* DOM element for the placement */,
},
{
financingType: "installments" /* card | installments */,
locationType: "banner" /* product | cart | banner | checkout */,
@sohara
sohara / contentful-legal-docs.md
Created November 11, 2019 22:44
Legal Documents in Contentful
@sohara
sohara / bye-bye-props.md
Last active May 30, 2019 14:28
Mitigating proliferation of props when using SoulCylce UI Kit

Mitigating proliferation of props in the SoulCylce UI Kit Header (aka "I want less [sic] props")

The current implemention of the UI Kit header relies entirely on various props passed to the <Header /> component to determine all aspects of what will be rendered within it and when. This allows for a more or less deterministic rendering of the component between Podium SoulCycle Site (PSS) and the older Soul Cycle Site (SCS), assuming both apps pass the same props to the <Header />.

As a component like the header is built out it's child components grow in number and complexity, resulting in a growing number of dependencies. Since the header in its current implementation is effectively a black box, the only way to provide those dependencies to the child components is to pass them down the component hierarchy as props, starting with the <Header /> invocation itself.

Here is the current invocation of the header in PSS in the _app.js file:

import { Header } from 'soulcycle-ui-kit';
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'li',
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init () {
this._super(...arguments);
this.set('parent', this.get('store').createRecord('parent'));
},
actions: {
@sohara
sohara / EmberModelSerialized.json
Created June 26, 2018 19:09
Comparing Request Body output
{
"id": "5b30fc28c0895718b377e124",
"publishHistory": {
"page": 1,
"totalCount": 3,
"meta": {
"collectionName": "articles",
"modelName": "article",
"publishable": true,
"image": false,
import Ember from 'ember';
export default Ember.Component.extend({
});
// Running cold ember build on master, now changes
// Build 1
Build successful (55229ms) – Serving on http://localhost:4200/
Slowest Nodes (totalTime => 5% ) | Total (avg)
----------------------------------------------+---------------------
SassCompiler (7) | 22869ms (3267 ms)
Concat (6) | 11174ms (1862 ms)