Skip to content

Instantly share code, notes, and snippets.

View chris-feist's full-sized avatar

Chris Feist chris-feist

View GitHub Profile
@chris-feist
chris-feist / babel-plugin-testable-source.js
Last active September 11, 2018 21:35
Sample source code for babel-plugin-testable
// @testable
const cache = {};
// @testable
function getKey(firstName, lastName) {
return `${firstName}_${lastName}`;
}
export const putUser = (user) => {
const key = getKey(user.firstName, user.lastName);
@chris-feist
chris-feist / babel-plugin-testable-tests.js
Last active September 11, 2018 21:47
Sample test code for babel-plugin-testable
import { putUser, getKey, cache } from './babel-plugin-testable-source.js';
beforeEach(() => {
// Reset cache
for (const key of Object.keys(cache)) {
delete cache[key];
}
});
describe('getKey', () => {
@chris-feist
chris-feist / .babelrc
Created September 11, 2018 21:41
babel-plugin-testable example babelrc file
{
"plugins": ["testable"]
}
@chris-feist
chris-feist / README.md
Last active January 4, 2019 21:19
Readme file for serverless-plugin-easy-vars

serverless-plugin-easy-vars

This plugin is Serverless variables reimagined, making them configurable and easier to manage. It automatically scans for variables.yml and environment.yml files in your service directory to assign custom and environment variables in your service. In addition, it easily allows for stage specific overrides by loading variables.stage.yml and environment.stage.yml where stage is your deployment stage, like beta or prod.

npm downloads total npm version npm license

Installation

npm install -D serverless-plugin-easy-vars
@chris-feist
chris-feist / environment.prod.yml
Created January 12, 2019 18:22
serverless-plugin-composed-vars example
USER_TABLE_NAME: Users
@chris-feist
chris-feist / serverless.yml
Created January 16, 2019 05:09
serverless-plugin-composed-vars base example
custom:
googlesWebsite: www.google.com
myEndpoint: api.endpoint.com/dev
provider:
environment:
THE_ANSWER_IS: 42
USER_TABLE_NAME: Test-Users
MY_ENDPOINT: ${self:custom.myEndpoint}
@chris-feist
chris-feist / variables.prod.yml
Last active January 16, 2019 05:12
serverless-plugin-composed-vars base example variables prod
# Prod custom variables
myEndpoint: api.endpoint.com
@chris-feist
chris-feist / environment.prod.yml
Last active January 16, 2019 05:12
serverless-plugin-composed-vars base example environment prod
# Prod environment variables
USER_TABLE_NAME: Users
@chris-feist
chris-feist / variables.prod.yml
Last active January 16, 2019 05:17
serverless-plugin-composed-vars variables example prod
# Prod custom variables
endpoint: endpoint.com
@chris-feist
chris-feist / variables.qa.yml
Created January 16, 2019 05:16
serverless-plugin-composed-vars variables example QA
# QA custom variables
endpoint: endpoint.com/qa