Skip to content

Instantly share code, notes, and snippets.

View tribou's full-sized avatar

Aaron Tribou tribou

View GitHub Profile
@tribou
tribou / TodoItem.jsx
Last active October 14, 2015 01:03
A sample React component before migrating to ES6
var React = require('react');
var TodoActions = require('../actions/TodoActions.js');
module.exports = React.createClass({
render: function() {
return(
<tr>
<td>{this.props.item}</td>
@tribou
tribou / RandomUserAPI.js
Last active October 14, 2015 04:09
A sample React API utility implemented in ES6
// Random User API logic
import { receiveRandom } from '../actions/TodoServerActions';
import request from 'superagent';
export function getRandomApi() {
request.get('http://api.randomuser.me/')
.set('Accept', 'application/json')
.end((err, response) => {
if (err) return console.error(err);
@tribou
tribou / TodoItem.jsx
Last active October 14, 2015 04:07
A sample React component in ES6 using the React style guide
import React from 'react';
import { removeItem } from '../actions/TodoActions.js';
export default class TodoItem extends React.Component {
constructor(props) {
super(props);
this._delete = this._delete.bind(this);
}
@tribou
tribou / .eslintrc
Created September 29, 2015 03:01
Including Airbnb's ESlint configuration
{
"extends": "airbnb"
}
# On OSX, install brew for all the things
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Brew Caskroom
brew install caskroom/cask/brew-cask
# Install Google Cloud SDK
brew cask install google-cloud-sdk
# After installing, follow the printed instructions to add the paths
gcloud container clusters create cluster-1 \
--num-nodes 1 \
--disk-size 10 \
--machine-type f1-micro \
--no-enable-cloud-logging \
--no-enable-cloud-monitoring
# When it's done, your kubectl command should work
kubectl cluster-info
@tribou
tribou / webpack.config.js
Last active March 7, 2017 20:34
Including Babel.js and ESlint with Webpack
// Webpack config file
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
entry: './assets/js/components/Index.jsx',
output: {
path: __dirname + '/assets/js',
filename: 'bundle.js'
},
module: {
// Webpack config file
var BrowserSyncPlugin = require('browser-sync-webpack-plugin');
module.exports = {
entry: './assets/js/components/Index.jsx',
output: {
path: __dirname + '/assets/js',
filename: 'bundle.js'
},
module: {
FROM todo
ADD . /usr/src/app
RUN npm build
CMD npm start
.git
.gitignore
.editorconfig
node_modules
*.log
*.md