Skip to content

Instantly share code, notes, and snippets.

View oliviertassinari's full-sized avatar

Olivier Tassinari oliviertassinari

View GitHub Profile
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} />;
}
// @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,
@oliviertassinari
oliviertassinari / crashReporter.js
Last active September 10, 2020 15:02
Track offline errors with sentry.io and raven-js. https://github.com/getsentry/raven-js/issues/279
// @flow weak
import raven from 'raven-js';
import config from 'config';
const SENTRY_DSN = 'https://[email protected]/YYYY';
function sendQueue() {
const sentryOffline = JSON.parse(window.localStorage.sentryOffline);
'use strict';
var inputs = readline().split(' ');
var players = {
list: [],
meId: parseInt(inputs[3]), // id of my player (0 = 1st player, 1 = 2nd player, ...)
me: {},