Skip to content

Instantly share code, notes, and snippets.

Avatar
☀️
Outside, walking the dogs

Adam Gajzlerowicz adamgajzlerowicz

☀️
Outside, walking the dogs
View GitHub Profile
View .hyper.js
// 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',
View increase android build number
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
def versionPropsFile = file('version.properties')
def code
View gist:32a3a10599623ec8987a902a3928d3d4
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]
View jest mock component to string
jest.mock('../../../../components/ComponentFoo', () => 'foo')
View gist:3c69dd1df55d7b8c0cba9e9b8ffe552b
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)
}