- If you need to use material icons in your project for example.
- If you need to add cusom icons
File examples bellow
const Table = ({data }) => { | |
if(data.length === 0) return null; | |
const rows = Object.keys(data[1]); | |
return ( | |
<table> | |
<thead> | |
<tr> | |
{rows.map(key => ( | |
<th>{key}</th> |
import { PACKAGE_NAME } from 'src/constants'; | |
const metaMiddleware = ({ getState }) => next => (action) => { | |
const store = getState(); | |
const user = store[PACKAGE_NAME].user; | |
const transport = store[PACKAGE_NAME].transport; | |
next({ | |
...action, | |
meta: { |
import React, { useState, useEffect } from 'react'; | |
export default function useListIterate(items, interval = 3000) { | |
const [item, setItem] = useState(items[0]); | |
useEffect(() => { | |
let index = 0; | |
const timer = setInterval(() => { | |
setItem(items[index]); |
#!/usr/bin/env bash | |
set -e | |
# Usage: | |
# | |
# bash ./scripts/git-files COMMIT_HASH | |
# | |
# Usage in script: | |
# |
import React, { useEffect } from 'react'; | |
import ReactDOM from 'react-dom'; | |
const portalTarget = document.getElementById('portal'); | |
const Portal = ({ children }) => { | |
const element = document.createElement('div'); | |
useEffect(() => { | |
portalTarget.appendChild(element); |
#!/bin/bash | |
# Usage: | |
# ./scripts/git-files d304b82 | |
# | |
# Or in script: | |
# | |
# if [ `sh ./scripts/git-files d304b82` -gt 0 ]; | |
# then | |
# echo "matches"; |
export const lightOrDark = (color, ratio = 155) => { | |
const hex = color.replace('#', ''); | |
const red = parseInt(hex.substr(0, 2), 16); | |
const green = parseInt(hex.substr(2, 2), 16); | |
const blue = parseInt(hex.substr(4, 2), 16); | |
const brightness = (red * 299 + green * 587 + blue * 114) / 1000; | |
return brightness > ratio ? 'light' : 'dark'; | |
}; |
import spacy | |
from spacy.matcher import Matcher | |
from spacy.lang.en import English | |
nlp = English() | |
matcher = Matcher(nlp.vocab) | |
# create some patterns and add to matcher | |
pattern1 = [{"LOWER": "iphone"}, {"LOWER": "x"}] | |
pattern2 = [{"LOWER": "iphone"}, {"IS_DIGIT": True, "OP": "?"}] |
import faker from 'faker'; | |
export const dataStreamEntities = { | |
data: [ | |
{ | |
id: 6248, | |
name: 'Data Stream', | |
enabled: true, | |
sourceDisplayName: 'Google Analytics', | |
lastRunStatus: false, |