Skip to content

Instantly share code, notes, and snippets.

View ConAntonakos's full-sized avatar
🏠
Working from home

Constantine Antonakos ConAntonakos

🏠
Working from home
View GitHub Profile
@laytong
laytong / bad-input.jsx
Last active December 18, 2021 06:16
How to debounce your inputs for super fast react/redux components
import React, {Component, PropTypes} from 'react';
class BadInputComponent extends Component {
static propTypes = {
text = PropTypes.string.isRequired,
updateText = PropTypes.func.isRequired,
};
render() {
return (
@tkh44
tkh44 / TransitionGroup.js
Last active November 22, 2018 18:13
Helper for react motion to stagger animation mounting with TransitionMotion component. Props to https://github.com/maisano/react-router-transition for the idea
import { createElement, cloneElement, Children } from 'react';
import { TransitionMotion, spring, presets } from 'react-motion';
import compose from 'recompose/compose';
import defaultProps from 'recompose/defaultProps';
import withHandlers from 'recompose/withHandlers';
import toClass from 'recompose/toClass';
const TransitionGroup = compose(
defaultProps({
component: 'div',
@acdlite
acdlite / app.js
Last active January 20, 2023 08:23
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@nathan-osman
nathan-osman / win32.go
Last active August 31, 2023 22:01
Simple Windows GUI application written in Go
package main
import (
"log"
"syscall"
"unsafe"
)
var (
kernel32 = syscall.NewLazyDLL("kernel32.dll")
@addyosmani
addyosmani / pwas.md
Last active June 10, 2020 18:30
💄💋 Progressive Web Apps across popular frameworks that I have written or contributed significantly to

React HN (Universal rendering, Offline caching, optimisations)

React + Webpack application using the PRPL pattern

The unknown-prop warning will fire if you attempt to render a DOM element with a prop that is not recognized by React as a legal DOM attribute/property. You should ensure that your DOM elements do not have spurious props floating around.

There are a couple of likely reasons this warning could be appearing:

  1. Are you using {...this.props} or cloneElement(element, this.props)? Your component is transferring its own props directly to a child element (eg. https://facebook.github.io/react/docs/transferring-props.html). When transferring props to a child component, you should ensure that you are not accidentally forwarding props that were intended to be interpreted by the parent component.

  2. You are using a non-standard DOM attribute on a native DOM node, perhaps to represent custom data. If you are trying to attach custom data to a standard DOM element, consider using a custom data attribute (https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes).

  3. React does not yet reco

@kkoch986
kkoch986 / MultiSelect.jsx
Last active March 6, 2017 08:58
A MultiSelect prototype for Material UI (v.0.14.4)
/**
* Material UI multi select
*
* Use with:
* <MultiSelect fullWidth={true} value={this.state.values} onChange={(e,v) => this.setState({values: v})}>
* <ListItem primaryText={"Option 1"} value={1} />
* <ListItem primaryText={"Option 2"} value={2} />
* <ListItem primaryText={"Option 3"} value={3} />
* <ListItem primaryText={"Option 4"} value={4} />
* </MultiSelect>
@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example

Turning Off Github Issues

My friend Michael Jackson turned off github issues on one of his smaller projects. It got me thinking...

Maintainers getting burned out is a problem. Not just for the users of a project but the mental health of the maintainer. It's a big deal for both parties. Consumers want great tools, maintainers want to create them, but maintainers don't want to be L1 tech support, that's why they

@brandondurham
brandondurham / styles.less
Last active January 11, 2024 06:46
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):