Skip to content

Instantly share code, notes, and snippets.

View MarvinAmador7's full-sized avatar
🏠
Working from home

Marvin Amador Campos MarvinAmador7

🏠
Working from home
View GitHub Profile
@MarvinAmador7
MarvinAmador7 / .eslintrc.js
Created January 27, 2016 09:11 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@MarvinAmador7
MarvinAmador7 / Install Composer using MAMP's PHP.md
Created March 18, 2016 16:26 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@MarvinAmador7
MarvinAmador7 / .flowconfig
Created March 15, 2017 15:51 — forked from MoOx/.flowconfig
flow config webpack adjustements to avoid the "Required module not found" for png, css, svg etcc
# ...
[options]
# webpack loaders
module.name_mapper='.*\.css$' -> '<PROJECT_ROOT>/flow/stub/css-modules.js'
module.name_mapper='.*\.\(svg\|png\|jpg\|gif\)$' -> '<PROJECT_ROOT>/flow/stub/url-loader.js'
{
"React Stateless Component": {
"prefix": "rsc",
"body": [
"// @flow",
"import React from 'react';",
"import injectSheet from 'react-jss';",
"import ${1:method} from '${2:moduleName}';",
"",
"// Styles",
@MarvinAmador7
MarvinAmador7 / redux_v3.x.x.jsx
Created April 25, 2017 00:38 — forked from pcardune/redux_v3.x.x.jsx
This gist shows how to add support for redux-thunk and redux-promise-middleware to the flowtype libdefs for redux
// flow-typed signature: ba132c96664f1a05288f3eb2272a3c35
// flow-typed version: c4bbd91cfc/redux_v3.x.x/flow_>=v0.33.x
declare module 'redux' {
/*
S = State
A = Action
@MarvinAmador7
MarvinAmador7 / redux-is-smarter-than-you-think.md
Created May 3, 2017 15:02 — forked from armw4/redux-is-smarter-than-you-think.md
Optimizing your react components via redux....shouldComponentUpdate for free and more...

The Beginning

Yes...it's true...redux is smart....smarter than you even know. It really does want to help you. It strives to be sane and easy to reason about. With that being said, redux gives you optimizations for free that you probably were completely unaware of.

connect()

connect is the most important thing in redux land IMO. This is where you tie the not between redux and your underlying components. You usually take state and propogate it down your component hiearchy in the form of props. From there, presentational

import React, { Component } from 'react';
import { Router, Switch, Route } from 'react-router-dom';
import createBrowserHistory from 'history/createBrowserHistory';
import { Provider } from 'mobx-react';
import { ThemeProvider } from 'react-jss';
import PropTypes from 'prop-types';
// Stores
import Root from 'stores/RootStore';