Skip to content

Instantly share code, notes, and snippets.

View adamgajzlerowicz's full-sized avatar
👋
Clear is better than clever

Adam Gajzlerowicz adamgajzlerowicz

👋
Clear is better than clever
View GitHub Profile
import { ParticipantWithRunsAndResults, SingleRunOfParticipant } from '../types/common'
import { RunCategory } from '../__types__/graphql'
import { isRunFinished } from './utils'
const maxPoints: Record<RunCategory, number> = {
[RunCategory.MinusA0]: 0,
[RunCategory.A0]: 0,
[RunCategory.A1]: 100,
[RunCategory.A2]: 100,
[RunCategory.A3]: 100,
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
def versionPropsFile = file('version.properties')
def code
import { PureComponent } from 'react';
PureComponent.componentDidUpdate = prevProps => {
const name =
this.constructor.displayName || this.constructor.name || 'Component';
console.group(name);
Object.keys(prevProps).forEach(key => {
if (prevProps[key] !== this.props[key]) {
console.log(
`property ${key} changed from ${prevProps[key]} to ${
this.props[key]
jest.mock('../../../../components/ComponentFoo', () => 'foo')
import React from 'react'
const withClickOutside = Component => {
class Wrapped extends React.Component {
constructor(props) {
super(props)
this.setWrapperRef = this.setWrapperRef.bind(this)
this.handleClickOutside = this.handleClickOutside.bind(this)
}