Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bjankord's full-sized avatar
🎵
Chillin'

Brett Jankord bjankord

🎵
Chillin'
View GitHub Profile
@bjankord
bjankord / updates.diff
Created March 9, 2019 07:53
Frame.jsx diff
@ packages/terra-form-select/src/_Frame.jsx:207 @ class Frame extends React.Component {
className: cx('search-input', { 'is-hidden': Util.shouldHideSearch(this.props, this.state) }),
};
+ const selected = 'selected!';
switch (variant) {
case Variants.TAG:
case Variants.MULTIPLE:
@ packages/terra-form-select/src/_Frame.jsx:224 @ class Frame extends React.Component {
@bjankord
bjankord / memoized-custom-properties-check.js
Created December 26, 2018 19:06
memoized-custom-properties-check
/* Didn't notice any perf improvement with memozing this, actually saw a regression
memoized custom property check, may see improvement if called more frequently */
const customPropertyCheck = () => {
let cache = {};
console.log(cache);
return () => {
if ('customProperties' in cache) {
console.log('Fetching from cache');
return cache['customProperties'];
}

react-dates uses an aria-describedby on the input attribute that points to a p element with the following content within it. "Press the down arrow key to interact with the calendar and select a date. Press the question mark key to get the keyboard shortcuts for changing dates."

  • Focusing on the input reads, "Date, edit text" followed by the aria-describedby content.
  • Pressing ? key opens a modal with the following keyboard shortcuts:

Keyboard Shortcuts

  • ↵ Select the date in focus.
  • ←/→ Move backward (left) and forward (right) by one day.

Get all packages

Get all packages by running lerna ls. Convert this to an array Save array as a const named all.

Get updated packages

Get updated package by running lerna updated Convert this to an array Save array as a const named updated.

@bjankord
bjankord / gist:2572749
Created May 2, 2012 00:57
Picture Source src modification through CSS image-set and URI Templates
<head>
<style type="text/css">
picture source {
src: image-set(url({filename}@2x.{ext} 2x high-bandwidth));
}
@media screen and (min-width:321px){
picture source {
src: image-set(url({filename}-m.{ext}), url({filename}-m@2x.{ext} 2x high-bandwidth));
}
}
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