Skip to content

Instantly share code, notes, and snippets.

View joshblack's full-sized avatar

Josh Black joshblack

View GitHub Profile
@joshblack
joshblack / carbon-faq.md
Last active April 17, 2018 13:58
Carbon Design System FAQs

FAQs

Components

Accordion

Is it possible to have an accordion nested inside an accordion?
Including scss files

Releases

Library Category Type of change Major Minor Patch Experimental No change
React
Prop Types
New prop added
Existing prop type changed
Existing prop removed
Package
const numbers = [0, 1, 2, 3, 4, 5];
const split = (collection, filters) => {
const result = [];
for (let i = 0; i < filters.length; i++) {
result[i] = [];
}
collection.forEach((element) => {
filters.forEach((filter, i) => {
[
{
"S2CellId": {
"low": 1073741824,
"high": -2040844917,
"unsigned": true
},
"AsOfTimeMs": {
"low": 623625368,
"high": 342,
[
'_plugins',
'compiler',
'resolvers',
'inputFileSystem',
'options',
'outputOptions',
'bail',
'profile',
'mainTemplate',
{ id: '841',
displayName: 'JOSHUA T. BLACK',
username: 'joshblack',
profileUrl: 'https://github.ibm.com/joshblack',
emails: [ { value: 'joshblack@us.ibm.com' } ],
photos: [ { value: 'https://avatars.github.ibm.com/u/841?' } ],
provider: 'github',
_raw: '{"login":"joshblack","id":841,"avatar_url":"https://avatars.github.ibm.com/u/841?","gravatar_id":"","url":"https://github.ibm.com/api/v3/users/joshblack","html_url":"https://github.ibm.com/joshblack","followers_url":"https://github.ibm.com/api/v3/users/joshblack/followers","following_url":"https://github.ibm.com/api/v3/users/joshblack/following{/other_user}","gists_url":"https://github.ibm.com/api/v3/users/joshblack/gists{/gist_id}","starred_url":"https://github.ibm.com/api/v3/users/joshblack/starred{/owner}{/repo}","subscriptions_url":"https://github.ibm.com/api/v3/users/joshblack/subscriptions","organizations_url":"https://github.ibm.com/api/v3/users/joshblack/orgs","repos_url":"https://github.ibm.com/api/v3/users/joshblack/repos","events_url":

Creating a line in D3 in React

import {
  scaleLinear,
  scaleTime,
} from 'd3-scale';
import {
  line
} from 'd3-shape';
function * Producer() {
let number = 0;
while (true) {
yield number++;
}
}
function * takeWhile(iterator, predicate) {
let finished = false;
export default function ({ types: t }) {
return {
visitor: {
JSXText(path) {
path.replaceWith(
t.expressionStatement(
t.callExpression(
t.identifier('__'),
[t.stringLiteral(path.node.value)]
)

Sketch Tips

context

Properties:

  • document
  • selection
  • scriptPath
  • scriptURL