Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
Where am I?

Chris Zhang chriszhangusc

🤔
Where am I?
View GitHub Profile
@chriszhangusc
chriszhangusc / how-to-setup-mac-elasticsearch.md
Created Jan 2, 2018 — forked from jpalala/how-to-setup-mac-elasticsearch.md
setting up elasticsearch on your mac with brew
View how-to-setup-mac-elasticsearch.md

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.

View on-jsx.markdown

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I lead the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can'

View withImageFadeInOnLoad.jsx
import React from 'react';
import { getDisplayName } from 'common/utils/hocUtils';
export default function withImageFadeInOnLoad(ImageComponent) {
class FadeInImage extends React.Component {
constructor(props) {
super(props);
this.state = {
imageLoaded: false,
};
View FadeInImage.jsx
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
const EnhancedImageContainer = styled.div`
height: 100%;
width: 100%;
border-radius: ${props => props.circle && '50%'};
background-image: ${props => props.fallback && 'linear-gradient(135deg,#846170,#8e8485)'};
display: inline-block;
View webpack1.prod.config.js
// Currently not active
// Webpack1 config for production
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: [
path.resolve(__dirname, 'client', 'index.jsx'),
],
View webpack1.dev.config.js
// Currently not active
// Webpack1 config for development
var path = require('path');
var webpack = require('webpack');
var buildPath = path.resolve(__dirname, 'public', 'build');
var PORT = process.env.PORT || 3000;
module.exports = {
entry: [
View webpack2.config.js
// For Webpack 2
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HTMLWebpackPlugin = require('html-webpack-plugin');
const PORT = process.env.PORT || 3000;
var production = process.env.NODE_ENV === 'production';
@chriszhangusc
chriszhangusc / README.md
Created Feb 12, 2017 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet
View README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage