I hereby claim:
- I am davidfurlong on github.
- I am graph (https://keybase.io/graph) on keybase.
- I have a public key whose fingerprint is 09E5 4284 984D BE6D 3338 5A78 52BB 204B 2564 24F7
To claim this, I am signing this object:
// Returns the score if within the proximity, else returns -1 | |
Array.prototype.indexOfAll = function(term) { | |
if(typeof term == 'object'){ | |
console.error('indexOfAll expects an array of terms as an argument'); | |
return; | |
} | |
var posOfTerms = []; | |
for(i in this){ | |
if(this[i] == term){ |
I hereby claim:
To claim this, I am signing this object:
var Col = require('react-bootstrap/lib/Col') | |
var PageHeader = require('react-bootstrap/lib/PageHeader') | |
var React = require('react') | |
var Row = require('react-bootstrap/lib/Row') | |
var {connect} = require('react-redux') | |
var {reduxForm} = require('redux-form') | |
var DateInput = require('./DateInput') | |
var FormField = require('./FormField') | |
var LoadingButton = require('./LoadingButton') |
/* | |
A react higher order component (HOC) for disabling server side rendering (SSR) for a particular component. | |
Useful if a particular library / page doesn't support SSR and you | |
a) dont want to mess around with the server routing to handle it | |
b) dont want to the component to even be constructed on the server | |
c) dont want to modify the component's methods to handle loading the library on the client | |
(for example, you need to use window/client methods in the constructor) | |
DISCLAIMER: this is hacky, and will throw a console warning (in development) that the checksum is invalid (which means server & client rendering dont agree on HTML string) |
/* its not immediately obvious how to do this, which is why I've added it here */ | |
const connectSubmitButton = (WrappedComponent) => { | |
const connectContext = (props, context) => (<WrappedComponent {...props} _reduxForm={context._reduxForm} />); | |
connectContext.contextTypes = { | |
_reduxForm: PropTypes.object.isRequired | |
}; | |
return connectContext; | |
}; |
const _ = (obj, cond = (val) => typeof val === 'undefined' || val === null) => | |
Object.assign({}, | |
...(Object.keys(obj).map(key => | |
cond(obj[key]) ? {} : { | |
[key]: obj[key] | |
}) | |
) | |
); | |
/* |
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
import React from 'react'; | |
import { Tabs } from 'antd'; | |
import PropTypes from 'prop-types'; | |
import { browserHistory } from 'react-router'; | |
function isLeftClickEvent(event) { | |
return event.button === 0; | |
} | |
function isModifiedEvent(event) { |