Skip to content

Instantly share code, notes, and snippets.

Avatar

Christiano Milfont cmilfont

View GitHub Profile
View tsconfig.json
{
"compilerOptions": {
"target": "ES2017",
"module": "CommonJS",
"moduleResolution": "node",
"outDir": "./build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true
}
@cmilfont
cmilfont / S3-Static-Sites.md
Created Dec 30, 2019 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.
View S3-Static-Sites.md

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources

@cmilfont
cmilfont / redux.js
Last active Nov 8, 2019
Usando Redux sem combineReducer
View redux.js
import { LOCATION_CHANGE } from 'connected-react-router';
import { connectRouter } from 'connected-react-router';
export default history => {
const handleRouter = connectRouter(history);
const initialState = {
router: connectRouter(history)
};
View saga.js
import { take, put, call } from 'redux-saga/effects';
import { eventChannel } from 'redux-saga';
import { push } from 'react-router-redux';
import actions from 'api/actions';
import reducer from 'api/reducers/crud';
import { loginMutation as mutation } from 'api/graphql/mutations';
function createSocketChannel(firebase) {
return eventChannel((emit) => {
return firebase.auth()
@cmilfont
cmilfont / commit.sh
Last active Nov 27, 2017
Scripts para facilitar o workflow de release e corretamente gerar o changelog
View commit.sh
#!/bin/sh -x
CURRENT=`git branch | grep "*" | awk '{print $2}'`
git commit -m "#${CURRENT}: $1"
# git add .
# commit "message"
View redux-error.js
// model error
import { Record, fromJS, Map } from 'immutable';
export default class ErrorRecord extends Record({
warnings: Map(),
form: Map(),
fatal: Map(),
}) {
constructor(values) {
// sua lógi a
View componentDidCatch.js
import React from 'react';
import { connect } from 'react-redux';
import { actions, mapDispatchToProps} from 'api/actions/errors';
class ErrorBoundary extends React.Component {
componentDidCatch(error, info) {
this.props.dispatch({
type: actions.GLOBAL_EXCEPTION,
payload: {
@cmilfont
cmilfont / README.md
Last active Aug 9, 2017
CI do Diário Oficial do CE que foi feito no final de 2004 e concluído em 2006, até hoje no ar com a mesma versão aparentemente http://pesquisa.doe.seplag.ce.gov.br/doepesquisa/sead.do?page=ultimasEdicoes&cmd=11&action=Ultimas
View README.md

Características

Esse projeto era deployado num Oracle Server OC4J, os fontes no CVS do governo do estado do CE, a busca textual foi feita com Oracle Text.

Levamos quase 2 anos pra fazer um sistema que hoje seria concluído no máximo em 1 mês, pra ter uma idéia como quando cheguei aqui era tudo mato :D

A briga da época era se a modinha SVN ia pegar.

Por limitações da licitação desse projeto, não pudemos usar Hibernate e Spring que eram as modinhas que estavam dominando o mercado.

You can’t perform that action at this time.