Skip to content

Instantly share code, notes, and snippets.

@bassettsj
bassettsj / example.js
Last active March 10, 2016 00:23
Flow Causing Problems
/* @flow */
import { autobind } from 'core-decorators';
import React, { Component } from 'react';
import ListItem from 'apps/shared/dev/view/components/ProgressTracker/ListItem';
type ListItemData = {
label: string,
status: number,
completed: boolean
}
var time = 1
while (time > 0) {
console.log('the time is ' + time);
time++;
}
/*!
* @gigwalk/navigator-js - v0.6.0 - 2016-02-18
* undefined
* Copyright (c) 2016 Bigger Boat
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
@bassettsj
bassettsj / handling-data-in-react.md
Last active February 1, 2016 19:41
Handling Data in React

Handling Data in React Components

How should we handle building reusable components in an application that uses a dependency injection library?

  1. Use the injection library as the only binding to instances of models, services and other dependencies in the application, only other properties will be given as additional propTypes: <Profile injector={injector} picSize="small" />
  2. Use injection library to set individual props on the component that will transfer properties down the component tree, explicity stating the required data for the components:
class Profile extends Component {
✘  ~/Sites/eomobile-binder/eomobile-frontend   EOM-2378_update_node_npm_recipies  rm -rf node_modules
~/Sites/eomobile-binder/eomobile-frontend   EOM-2378_update_node_npm_recipies  npm i
npm WARN prefer global marked@0.3.5 should be installed with -g
npm WARN prefer global jshint@2.8.0 should be installed with -g
npm WARN prefer global pangyp@2.3.2 should be installed with -g
> bufferutil@1.1.0 install /Users/stevenbassett/Sites/eomobile-binder/eomobile-frontend/node_modules/bufferutil
> node-gyp rebuild
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
@bassettsj
bassettsj / gist:3d1ef7ec4b2b3090b0ae
Created September 10, 2015 20:32
working provision
File sync using Shared Folders
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Fetching 'binder-eomobile' from source at ../agate-stack-mobile-cookbook
==> default: Using apt-repo (0.1.2)
==> default: Using agate (1.1.0) from http://stash.odesk.com/scm/ad/agate-cookbook.git (at master)
==> default: Using apache2 (3.1.0)
==> default: Using 7-zip (1.0.2)
@bassettsj
bassettsj / stdout-vagrant.log
Created September 10, 2015 03:19
Deploy fail
File sync using Shared Folders
Bringing machine 'default' up with 'virtualbox' provider...
default: The Berkshelf shelf is at "/Users/stevenbassett/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150909-24074-tuqzxq-default"
==> default: Sharing cookbooks with VM
==> default: Importing base box 'phusion/ubuntu-14.04-amd64'...
Progress: 10%
Progress: 20%
Progress: 30%
Progress: 40%
@bassettsj
bassettsj / eomobile-npm-install.log
Created September 9, 2015 20:19
Replaces the nex tooling
npm i
npm WARN deprecated pangyp@2.3.2: use node-gyp@3+, it does all the things
npm WARN prefer global marked@0.3.5 should be installed with -g
npm WARN prefer global jshint@2.8.0 should be installed with -g
npm WARN prefer global pangyp@2.3.2 should be installed with -g
> bufferutil@1.1.0 install /Users/stevenbassett/Sites/eomobile-binder/eomobile-frontend/node_modules/bufferutil
> node-gyp rebuild
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
@bassettsj
bassettsj / remove-duplicates.js
Created August 22, 2015 20:57
Remove Duplicates
(function() {
function removeDuplicates(list) {
var found = {};
var result = [];
var len = list.length;
var j = 0;
for (var i = 0; i < len; i++) {
var item = list[i];
if (found[item] !== 1) {
found[item] = 1;
@bassettsj
bassettsj / story.txt
Created August 13, 2015 21:49
Jira Templates
As a <type of user>, I want <some goal> so that <some reason>.
Further description of the problem
h6. Acceptance Criteria
# Testing plan for feature
# AB Testing Metrics Plan
# Any furter details
note: please include prioirty