Skip to content

Instantly share code, notes, and snippets.

@RabidFire
RabidFire / withAnchor.js
Created September 11, 2018 06:25
Nifty Anchor Scrolling React HOC
import jump from 'jump.js'
import React, { Component } from 'react'
function withAnchorScroll(WrappedComponent) {
return class ScrollToAnchors extends Component {
componentDidMount() {
const { location: { hash } } = this.props
if (hash) {
/*
@RabidFire
RabidFire / client__authLink.js
Last active September 10, 2018 07:34
React + Apollo Tricks & Boilerplate
@RabidFire
RabidFire / gist:5308182
Created April 4, 2013 05:59
Backbone Subset
Backbone.Subset = Backbone.Collection.extend({
superset: null,
initialize: function(models, options){
this.superset = options.superset || this.superset;
this.sieve = options.sieve || this.sieve;
if (!this.superset) throw new Error('Missing superset for Backbone.Subset');
_.each(['add', 'remove', 'reset', 'change'], function(evt){