Skip to content

Instantly share code, notes, and snippets.

View jeffkamo's full-sized avatar

Jeff Kamo jeffkamo

View GitHub Profile
// ...
// Near the bottom of the file, before the `module.exports`,
// paste in the following code:
const requestProcessor = Object.assign(
{},
{
entry: './app/request-processor.js',
target: 'node',
output: {
// In your project's /web/webpack directory
/* eslint-env node */
/* eslint-disable import/no-commonjs */
const path = require('path')
module.exports = {
entry: './app/request-processor.js',
target: 'node',
# Resources...
# CloudFrontDistribution...
# Properties...
# DistributionConfig...
# ...
DefaultCacheBehavior:
# ...
ForwardedValues:
Cookies:
Foreward: all
jest.mock('react-dom', () => ({
findDOMNode() {
return {
querySelectorAll: () => [],
contains: () => true
}
}
}))
@jeffkamo
jeffkamo / container.jsx
Last active July 29, 2017 00:03
Testing the Select component with a Redux Form
// bunch of imports...
/**
* Add these into the top of any container, and then add `<MyForm />`
* anywhere into the component to rendner the form.
*/
import Button from 'progressive-web-sdk/dist/components/button'
import Field from 'progressive-web-sdk/dist/components/field'
import FieldRow from 'progressive-web-sdk/dist/components/field-row'
import React, {PropTypes} from 'react';
import classnames from 'classnames';
import utilityClasses from './utilityClasses';
const Card = ({children, utilityClasses}) => { // how do we grab utility props, i.e. `boxShadow`, `paddingTop`, etc?
utilityClasses = {
...utilityClasses, // probably returns mostly false, except for some defaults?
'padding-all': 2,
}
@jeffkamo
jeffkamo / sass-extending-embedded-trailing-ampersands.scss
Last active December 21, 2015 11:49
Is Extending Classes that have embedded Trailing Ampersands inefficient? I shall investigate!
// Extending Selectors that use trailing ampersands
// ================================================
// Purpose
// -------
//
// To see what the final rendered output of extending
// modules that include trailing ampersands in a deeply
// nested selector.
@jeffkamo
jeffkamo / gist:5645052
Last active December 17, 2015 17:19
A SASS Mixin (written in SCSS) for converting pixels to rems.
// rem (Mixin)
// -----------
//
// Return font-size with a rem value based on the desired pixel value, as well
// as a fallback font-size value in em units (for IE8).
//
// Usage
//
// h1 {
// @include rem(font-size, 25, $fallback: false);
@jeffkamo
jeffkamo / gist:0c7acf7450d1e7fcd224
Created December 4, 2015 05:02
Code Review PR Description Template
(brief description / PR title)
Status: **Ready for Code Review**
Owners: **(Github @<name>s of all relevant sub-contractor employees)**
Reviewers: **(GitHub @<name>s of all reviewers)**
JIRA: [JIRA-ticket](https://mobify.atlassian.net/browse/JIRA-ticket)
## Changes
- (change1)
{
"stats": [
{
"name": "speedindex",
"budget": 1000,
"points": [
{
"id": 1,
"datetime": "20111001",
"value": 1000,