Skip to content

Instantly share code, notes, and snippets.

View chranderson's full-sized avatar
👋

Chris Anderson chranderson

👋
  • Denver, Colorado
View GitHub Profile
@chranderson
chranderson / gist:f9c391f8dbfc5c924694
Created September 29, 2015 16:30 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@chranderson
chranderson / gist:72194f8bf58b78660cbe
Created October 29, 2015 15:08
Push new objects to array upon DATA_SUCCESS action from api get request
const initialState = {
fieldMap = []
}
// take result, push objects to fielMap array
const createFieldMap = (result, fieldMap, fieldMapMade) => {
if (!fieldMapMade) {
result.headers.map((key, index) => {
const cardIndex = index;
const samplesArr = [];
import React, { Component, PropTypes } from 'react';
import {reduxForm} from 'redux-form';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as dataMapActions from 'redux/modules/dataMap';
import {updateFieldMap} from 'redux/modules/dataMap';
@connect(
state => ({
fieldMap: state.dataMap.fieldMap,
// src/container/form1.js
// when i add a file to this input, it triggers the FORM2 reducer's case: redux-form/CHANGE' and calls function in FORM2.
<input type="file" {...fileField}/>
// src/redux/modules/form1.js
export default function reducer(state = initialState, action = {}) {
switch (action.type) {
case FILE_SELECTED:
return {....}
}
@chranderson
chranderson / activator-setup.txt
Last active November 17, 2015 16:59
installing java / activator
install homebrew
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
install Java w/ homebrew **Dont install java with oracle**
> brew tap caskroom/cask
> brew install brew-cask
If you get the error "already installed", follow the instructions to unlink it, then install again:
> brew unlink brew-cask
> brew install brew-cask
'.source.js':
'component':
'prefix': 'comp'
'body': """
import React, { Component, PropTypes } from 'react';
import {
${1:Name}style
} from '${1:Name}Styles.js';
@chranderson
chranderson / remove-git-tag.sh
Created November 7, 2017 20:06
Remove git tag
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@chranderson
chranderson / installation.md
Created April 27, 2018 02:32
Hyper 2.0 Setup