Skip to content

Instantly share code, notes, and snippets.

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

Rafael de Bastiani Bastiani

🏠
Working from home
View GitHub Profile
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject",
"update-schema": "get-graphql-schema http://localhost:5000/graphql > src/schema.graphql",
"relay": "./node_modules/.bin/relay-compiler --src ./src/ --schema ./src/schema.graphql"
}
const { addBabelPlugins, disableEsLint, override } = require('customize-cra');
module.exports = override(disableEsLint(), ...addBabelPlugins('relay'));
const fs = require('fs');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
const paths = [
{ path: 'graphql/connection/', tag: 'Connection' },
function Person() {
this.name = 'Rafael';
this.age = 36;
return {
getName: () => {
return this.name;
},
getAge: () => {
return this.age;
import { Component } from 'react';
import { connect } from 'react-redux';
import * as actions from './actions';
let createHandlers = function(dispatch) {
let onClick = function(node, data) {
dispatch(actions.nodeClicked(data))
};
return {
@Bastiani
Bastiani / npm_config.md
Created June 22, 2017 13:51
config npm package

npm i --save-dev babel-preset-es2015 babel-preset-stage-1 babel-preset-react babel-cli

no package.json adicionar o seguinte:

"scripts": {
    "prepublishOnly": "babel --presets es2015,stage-1,react src -d lib"
  }
@Bastiani
Bastiani / freelancer.txt
Last active June 1, 2017 17:36
Isolar css para evitar conflitos
$ npm install less -g
freelancer.less:
.bootstrap-freelancer {
@import (less) 'freelancer.css';
}
$ lessc freelancer.less freelancer-convert.css
@Bastiani
Bastiani / react-router4.js
Created June 1, 2017 12:25
React Router 4
// Libs
import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
// Components
import App from './components/App';
import Home from './components/Home';
import About from './components/About';
import Teachers from './components/Teachers';
import Courses from './components/Courses';