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:
| // Use: var tree = new OST(); tree.select(4); tree.insert(key,value) | |
| var OST = function () { | |
| // Order statistic tree node | |
| var Node = function (leftChild, key, value, rightChild, parent) { | |
| return { | |
| leftChild: (typeof leftChild === "undefined") ? null : | |
| leftChild, | |
| key: (typeof key === "undefined") ? null : key, | |
| value: (typeof value === "undefined") ? null : value, | |
| rightChild: (typeof rightChild === "undefined") ? null : |
| // 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') |
Using Bookshelf.js with postgis and knex-postgis is a huge pain in the ass.
class Event extends Bookshelf.Model {
get tableName() { return 'event'; }
| /* | |
| 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] | |
| }) | |
| ) | |
| ); | |
| /* |