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
'use strict'; | |
var inputs = readline().split(' '); | |
var players = { | |
list: [], | |
meId: parseInt(inputs[3]), // id of my player (0 = 1st player, 1 = 2nd player, ...) | |
me: {}, |
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 weak | |
import raven from 'raven-js'; | |
import config from 'config'; | |
const SENTRY_DSN = 'https://XXXX@app.getsentry.com/YYYY'; | |
function sendQueue() { | |
const sentryOffline = JSON.parse(window.localStorage.sentryOffline); |
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 weak | |
function now() { | |
return +new Date(); // timestamp in ms | |
} | |
// Count the number of events sent over the last period of time. | |
const count = { | |
minute: { | |
slot: 0, |
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 classNames from 'classnames'; | |
import PropTypes from 'prop-types'; | |
function stylifier(higherOrderComponent) { | |
return Component => styles => { | |
function StyledComponent(props) { | |
const { classes, className, ...other } = props; | |
return <Component className={classNames(classes.root, className)} {...other} />; | |
} |
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 ReactDOM from 'react-dom'; | |
import PropTypes from 'prop-types'; | |
class RootRef extends React.Component { | |
componentDidMount() { | |
this.props.rootRef(ReactDOM.findDOMNode(this)) | |
} | |
componentWillUnmount() { |
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 warning from 'warning' | |
const times = new Map() | |
const implementations = { | |
mark: { | |
start: name => { | |
times.set(name, performance.now()) | |
performance.mark(`metric_${name}_start`) | |
}, |
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 { palette, spacing, typography } from '@material-ui/system'; | |
import styled from 'styled-components'; | |
const Box = styled.div`${palette}${spacing}${typography}`; | |
// or import { unstable_Box as Box } from '@material-ui/core/Box'; | |
<Box | |
color="primary.main" | |
bgcolor="background.paper" | |
fontFamily="h6.fontFamily" |
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, { ThemeProvider } from "styled-components"; | |
import { style, typography } from "@material-ui/system"; | |
const variant = style({ | |
prop: "variant", | |
cssProperty: false, | |
themeKey: "typography" | |
}); |
OlderNewer