This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
your-project/ | |
├── scss | |
│ ├── variables.scss | |
│ └── custom.scss | |
└── node_modules/ | |
└── bootstrap | |
├── js | |
└── scss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function initToggle({ | |
TOGGLE_SELECTOR = ".js-toggle", | |
TOGGLE_FOCUSED_CLASS = "toggle--focused", | |
TOGGLE_ITEM_OPEN_CLASS = "toggle__item--open", // use constants for class names and selectors variable name should end with _CLASS or _SELECTOR | |
}) { // use init functions that encapsulate functionality | |
const $toggle = $(TOGGLE_SELECTOR); // jQuery objects variable names should start with $ for jQuery elements | |
$toggle.on("focus", (event) => { | |
const $this = $(event.currentTarget); | |
$this.addClass(TOGGLE_FOCUSED_CLASS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import styled from "react-emotion"; | |
import { Flex, Box } from "grid-styled/emotion"; | |
import Text from "./Text"; | |
import Avatar from "./Avatar"; | |
const Comment = ({ children, ...props }) => children(props); | |
Comment.defaultProps = { | |
Wrapper: props => <Flex flexDirection="row" mb={"1rem"} {...props} />, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Comment | |
channel={channel} | |
createdAt={createdAt} | |
text={text} | |
getComments={getComments} | |
comments={comments} | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const FormattedNumber = ({ value, roundingFn = val => val }) => roundingFn(value); | |
//js | |
console.log( | |
FormattedNumber({value: 5.6}) /* 5.6 */ | |
); | |
//jsx | |
<FormattedNumber value={5.6} /> /* 5.6 */ | |
<FormattedNumber value={5.6} roundingFn={Math.floor} /> /* 5 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script data-senna-track="temporary" type="text/javascript"> | |
(function(i,s,o,r,g,v,a,m){ | |
g=v?g+'?v='+v:g;i['BrandEmbassy']=r; | |
i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)};i[r].l=+new Date(); | |
a=s.createElement(o);m=s.getElementsByTagName(o)[0];a.async=1;a.setAttribute("data-senna-track", "temporary"); | |
a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','brandembassy','https://livechat-static.brandembassy.com/3/chat.js'); | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
const deriveStateFromProps = (nextProps: Object, prevState: Object) => { | |
const derivedStateUpdate: Object = Object.keys(nextProps).reduce( | |
(acc, key) => { | |
if (nextProps[key] !== undefined && nextProps[key] !== prevState[key]) { | |
return { ...acc, [key]: nextProps[key] }; | |
} | |
return acc; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import { type Log } from "./Logs"; | |
type PropsAndState = { | |
/** value */ | |
value: number, | |
/** update value */ | |
updateValue: number => void, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rotate(element = $("body"), time = 20, turn = 1) { | |
element.style.transition = `all ${20}s ease-in-out`; | |
element.style.transform = `rotate(${turn}turn)`; | |
} | |
rotate($("body")); | |
// find all and spin | |
function findAll(element) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: octicons-link; | |
src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAA |