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 NodeRSA = require('node-rsa'); | |
export const generateWalmartHeaders = (consumerId, timestamp, publicKeyVersion, privateKey) => { | |
// the order here is important ... they are sorted according to the header names | |
const stringToSignComponents = [ | |
consumerId, | |
timestamp, | |
publicKeyVersion | |
]; | |
// join the components into one string, and add the trailing newline |
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
openssl rsa -in WM_IO_private_key.pem -out > WM_IO_private_key |
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
# Generate key pair 2048 bit | |
openssl genrsa -des3 -out WM_IO_my_rsa_key_pair 2048 | |
# Export private key WM_IO_private_key.pem | |
openssl pkcs8 -topk8 -inform PEM -in WM_IO_my_rsa_key_pair -outform PEM -out WM_IO_private_key.pem -nocrypt | |
#### THIS IS NEW #### | |
# Export private key WM_IO_private_key | |
openssl rsa -in WM_IO_private_key.pem -out > WM_IO_private_key | |
#### THIS IS NEW #### |
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
{ | |
"numFailedTestSuites": 0, | |
"numFailedTests": 0, | |
"numPassedTestSuites": 10, | |
"numPassedTests": 467, | |
"numPendingTestSuites": 0, | |
"numPendingTests": 0, | |
"numRuntimeErrorTestSuites": 0, | |
"numTotalTestSuites": 10, | |
"numTotalTests": 467, |
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 React from 'react'; // needed for JSX | |
export const AnyTag = (props) => { | |
// Create a Capitalized reference to a String | |
// whatever is in the string will be the tagname of our "Component" | |
const TagName = props.tagName; | |
// make a copy of props that we can mutate | |
let propsCopy = { ...props }; |
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 React from 'react'; // required in order to use JSX | |
import Type1 from './Type1'; // load one type of component | |
import Type2 from './Type2'; // load a second type of component | |
// a component that will render one or more components | |
// based on a switch statement | |
export const SwitchedComponent = (props) => { | |
let Output; // save the rendered JSX to return |
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 React from 'react'; // required to use JSX | |
export const CapitalizedReferenceComponentCollectionExternals = (props) => { | |
// get references to all possible components | |
// that this component might render, | |
// and the collection of dynamic components we need to render, | |
// using destructuring | |
const { components: Components, collection } = props; |
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 React from 'react'; // required to use JSX | |
export const CapitalizedReferenceComponentExternals = (props) => { | |
// get references to all possible components | |
// that this component might render | |
const { type, components: Components } = props; | |
// make a Capitalized reference to a specific component | |
// which we'll render |
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 React from 'react'; // required in order to use JSX | |
import Type1 from './Type1'; // load one type of component | |
import Type2 from './Type2'; // load a second type of component | |
// make references to the components by type | |
const Components = { | |
Type1, | |
Type2 | |
}; |
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
#!/bin/sh | |
######################### USAGE ######################### | |
# rename the plugin/script to include parameters for the | |
# minimum uptime before trying to enforce sleeping below | |
# the battery level and the battery level to sleep below | |
# use the format -<NUMBER>up-<NUMBER>perc | |
# | |
# example: sleepAt-10up-10perc.5m.sh | |
# |
NewerOlder