Skip to content

Instantly share code, notes, and snippets.

View bjankord's full-sized avatar
🎵
Chillin'

Brett Jankord bjankord

🎵
Chillin'
View GitHub Profile
if (!this.state.areTranslationsLoaded) return React.createElement('div', null, 'Translations are loading');
return React.createElement(
I18nProvider,
{ ...customProps, locale: this.state.locale, messages: messages },
children
);
@bjankord
bjankord / ControlledFileInput.jsx
Created August 3, 2018 12:05
Controlled File Input
class ControlledFileInput extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
console.log('Selected file:', event.target.files[0]);
}
@bjankord
bjankord / updated-deps.md
Last active July 25, 2018 02:30
Updated dependencies
terra-framework|master⚡ ⇒ npx recently-updated --days 5
node-fetch
        from ranges [^2.1.2, ^1.0.1]
        2.2.0   2018-7-22 16:32:05

danger
        from ranges [^3.7.14]
        3.8.0   2018-7-21 13:17:40
@bjankord
bjankord / paginator-with-button-component.jsx
Last active July 11, 2018 16:39
paginator-with-button-component
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames/bind';
import ResponsiveElement from 'terra-responsive-element';
import 'terra-base/lib/baseStyles';
import Button from '../../terra-button/src/Button';
import styles from './Paginator.module.scss';
import { calculatePages, pageSet, KEYCODES } from './_paginationUtils';
@bjankord
bjankord / wdio-errors-with-eslint-update.md
Created July 3, 2018 18:05
wdio-errors-with-eslint-update

1775 passing (2062.70s) 10 failing

  1. Abstract Modal Append Class [default] to be within the mismatch tolerance: expected to be within the mismatch tolerance, but received the following comparison results { "misMatchPercentage": 0.43 } running chrome AssertionError: expected to be within the mismatch tolerance, but received the following comparison results
/* eslint-disable no-unused-expressions */
/* global browser, Terra, before */
describe('Checkbox', () => {
before(() => browser.setViewportSize(Terra.viewports('medium')[0]));
const themingProperties = {
'--terra-form-checkbox-font-color': '#111619',
'--terra-form-checkbox-container-margin-bottom': '0.625rem',
'--terra-form-checkbox-container-margin-right': '1.071rem',
@bjankord
bjankord / output.sh
Created April 26, 2018 21:36
terra-framework-wdio-theme-output
․․․․․․․․․․․․․F․FFF․․․․․․F․F․․F․F․F․․․F․․․․․F․․․․․․․․F․․․F․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․F․․F․․․․․․․․․․․F․․․F․FFFFFFFFFFFFFFFFF․FF․F․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․F․․․․․․․․․․․․․․․․․․․․․․․․․F․FFFFFFFFF․FFF․․․․․․F․․․FF․․․․․․F․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․
559 passing (978.30s)
55 failing
1) ApplicationHeader Displays a default application header [#test-header] to be within the mismatch tolerance:
expected to be within the mismatch tolerance, but received the following comparison results
{
"viewport": "small",
"misMatchPercentage": 0.04
@bjankord
bjankord / find-and-replace-script.js
Last active July 12, 2019 11:19
Changelog find and replace script
#!/usr/bin/env node
/* eslint-disable no-console */
/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
const fs = require('fs');
const path = require('path');
const packagePaths = require('../peer-dependency-generator/getPackagePaths');
const findAndReplace = require('../peer-dependency-generator/findAndReplace');
// Generate the markdown to display peerDependencies information for each package
packagePaths.forEach((packagePath) => {
@bjankord
bjankord / install-time.md
Last active April 19, 2018 01:29
terra-core-install-time
Command Time
npm install 1627.22s user 206.98s system 318% cpu 9:35.32 total
yarn install 143.29s user 47.14s system 95% cpu 3:19.25 total
npm install (w/ lerna bootstrap and --hoist) 236.45s user 63.48s system 143% cpu 3:29.34 total
npm install (w/ lerna bootstrap and --hoist and root package-lock.json) 172.77s user 47.41s system 180% cpu 2:01.83 total
@bjankord
bjankord / blue-outline.css
Created November 21, 2017 17:16
Odd chrome focus styles
background-color: rgba(0, 0, 0, 0);
border-bottom-color: rgb(0, 0, 0);
border-bottom-style: none;
border-bottom-width: 0px;
border-image-outset: 0px;
border-image-repeat: stretch;
border-image-slice: 100%;
border-image-source: none;
border-image-width: 1;
border-left-color: rgb(0, 0, 0);