Skip to content

Instantly share code, notes, and snippets.

View prajapati-parth's full-sized avatar
:octocat:
undefined

Parth Prajapati prajapati-parth

:octocat:
undefined
View GitHub Profile
@aVolpe
aVolpe / EmbeddedGist.js
Created September 13, 2016 22:58
EmbeddedGist allows a gist to be embedded in a React application
import React, { Component } from 'react';
class EmbeddedGist extends Component {
constructor(props) {
super(props);
this.gist = props.gist;
this.file = props.file;
this.stylesheetAdded = false;
this.state = {
@zivni
zivni / InstanceMapReducerEnhancers.ts
Created July 25, 2016 06:32
Redux reducer enhancer to store specific control instance state by key
/**
* Use this reducer enhancer to store specific control instance state by key.
* The key will be resolved using the controlInstanceKeyResolver function parmeter which defaults to use the controlInstanceKey member of the action's meta object (i.e action.meta.controlInstanceKey)
* If the key is not a string then the action will be ignored and will not pass to the enhanched reducer.
* @param {function} reducer - the reducer to enhance
* @param {function} controlInstanceKeyResolver - an optional function to get the instance key from the action
*/
export function instanceMapReducerEnhancer(
reducer: Redux.Reducer,
controlInstanceKeyResolver: ((action) => string) = defaultKeyResolver) {
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream