This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first name | last name | age | |
---|---|---|---|
Stephen | Sugden | 31 | |
Tom | Reznik | 29 | |
Justin | Thomas | 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cy.get('[data-testid=grid-children]') | |
.should('have.prop', 'tagName') | |
.should('match', /div/i); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If all the tests happen on a single page with no dynamic changes | |
// use before instead of before each | |
// This exponentially reduces the test time. from 7.5s to 1.2s for only 5 tests. | |
before(() => { | |
cy.visit('/style-guide'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Cognito Stack | |
Parameters: | |
AuthName: | |
Type: String | |
Description: Unique Auth Name for Cognito Resources | |
Resources: | |
# Creates a role that allows Cognito to send SNS messages | |
SNSRole: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* script to export data of the named sheet as an individual csv files | |
* sheet downloaded to Google Drive and then downloaded as a CSV file | |
* file named according to the name of the sheet | |
* original author: Michael Derazon (https://gist.github.com/mderazon/9655893) | |
*/ | |
function onOpen() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var csvMenuEntries = [{name: "Download Primary Time File", functionName: "saveAsCSV"}]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const G99_REQUIRED_THRESHOLD = 3.68; | |
const assignByValue = (context, event) => event.value | |
const updateExistingPv = assign({existingPv: assignByValue}); | |
const updateProposedPv = assign({proposedPv: assignByValue}); | |
const updateBatteryOutput = assign({batteryOutput: assignByValue}); | |
const updateBatteryEnabled = assign({isBatteryEnabled: assignByValue}); | |
const updateG99DecisionOverridden = assign({hasG99DecisionBeenOverridden: assignByValue}); | |
const calcTotalOnSiteGeneration = assign({ | |
totalOnSiteGeneration: (context, event) => { | |
let result = context.existingPv + context.proposedPv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assignByValue = name => assign({ [name]: (context, event) => event.value }); | |
const addProduct = (logic, product) => | |
assign({ | |
products: (c, e) => (logic(c, e) ? c.products.concat(product) : c.products), | |
}); | |
const installCostsMachine = Machine( | |
{ | |
id: 'install_costs', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - assign | |
// - send | |
// - raise | |
// - actions | |
const loginMachine = Machine({ | |
id: 'login_machine', | |
initial: 'idle', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import { assign, Machine } from 'xstate'; | |
const MIN_NUM_SURVEYS = 1; | |
const MAX_NUM_SURVEYS = 4; | |
const surveyInitialState = { name: 'Default Name' }; | |
const canAdd = context => context.surveys.length < MAX_NUM_SURVEYS; | |
const canClone = context => context.surveys.length < MAX_NUM_SURVEYS; | |
const canUndoDelete = context => context.surveys.length < MAX_NUM_SURVEYS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
OlderNewer