Skip to content

Instantly share code, notes, and snippets.

View bernardodiasc's full-sized avatar

Bernardo Dias bernardodiasc

View GitHub Profile
/* component/styles.css */
.component.component-name a {
color: blue;
}
.component.component-name .title {
font-size: 9em;
}
127.0.0.1 hl2rcv.adobe.com
127.0.0.1 adobeereg.com
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require("extract-text-webpack-plugin");
require('es6-promise').polyfill();
module.exports = function(options) {
var entry, jsLoaders, plugins, cssLoaders, sassLoaders;
// If production is true
@bernardodiasc
bernardodiasc / React - Redux.md
Last active March 3, 2016 23:52
Redux short review

Redux

action -> reducer -> container -> view

Redux is an improvement over Flux architecture, the goal is provide a life cycle for the application. It is data driven with few templates with well defined purposes.

  • actions: action dispatch data changes triggered from view
  • reducer: receive action result and change data state (createStore(reducers))
  • container: it’s same as view component used differently, this component connects with store using redux lib (connect()(component)), usually contain view components for presentation
  • view: react to state changes and update markup, this is the react lib, also trigger actions (dispatch(action))

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'

abre o editor do browser na pagina http://www1.folha.uol.com.br/especial/2015/brasil-em-crise/votacao-impeachment/camara/
e cola o css abaixo:
.politic.col-sm-6.col-md-4.col-lg-3.yes:after {
content: '';
display: block;
width: 15px;
height: 15px;
position: absolute;
.politic.col-sm-6.col-md-4.col-lg-3.yes:after {
content: '';
display: block;
width: 15px;
height: 15px;
position: absolute;
z-index: 9;
background: red;
border-radius: 50%;
top: 27%;
<p><strong>ORIENTAÇÕES PARA LOCALIZAÇÃO DAS CONDICIONANTES DO EMPREENDIMENTO</strong></p>
<p>As condicionantes relativas ao Gasoduto Caraguatatuba-Taubaté (GASTAU), implantado a partir da Unidade de Tratamento de Gás e de Condensado de Caraguatatuba - UTGCA, em Caraguatatuba/SP, até a Estação de Compressão de Taubaté (ECOMP de Taubaté), em Taubaté/SP, encontram-se:</p>
<ul>
<li>No Item 7 “Medidas Mitigatórias e Compensatórias e Programas de Controle de Monitoramento” do Estudo de Impacto Ambiental do empreendimento;</li>
</ul>
<p>Fonte: <a href="http://licenciamento.ibama.gov.br/Dutos/Gasoduto/GASTAU/EIA%20CARAGUA-TAUBATE.pdf">http://licenciamento.ibama.gov.br/Dutos/Gasoduto/GASTAU/EIA%20CARAGUA-TAUBATE.pdf</a></p>
<ul>
<li>Na Licença Prévia LP nº 257/2007, páginas 2-4;</li>
<li>Na Licença de Instalação LI nº 522/2008, páginas 2-5;</li>
<li>Na Autorização de Supressão de Vegetação ASV nº 247/2008, páginas 2-3;</li>

JSON Schema validation

When dealing with data, the information is abstracted into a given structure, data are then pieces of information. In any application, the data can be semantically present in more than one and different structures, for instance, the database holds the application data with a structure that is not necessarily the same structure that the data is exposed in the web interface, but the data is still the same.

The more transformations, more complicated, as you have imagined. What happens in these transformations is a lot of code. There is the server-side with databases and integrations, there is the client-side with web, mobile, and many other applications. Many different ways to make all data transformations in all these different places.

The schema is the rules that configures the data structure. In JSON for instance, the data belongs to pieces called members. A member have the name and other properties, most important the type, that can be string, object or array, the schema defi

What takes (sort of) to have React+Redux SPA setup:

// This is used in a SPA setup using react and redux
import matchRoutes from 'react-router/lib/matchRoutes';
import { createRoutes } from 'react-router';
import { routerReducer } from 'react-router-redux';
import { Route, IndexRoute } from 'react-router';
import { useRouterHistory } from 'react-router';
import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux';