Skip to content

Instantly share code, notes, and snippets.

Avatar

Christiano Milfont cmilfont

View GitHub Profile
@cmilfont
cmilfont / peter-thiels-cs183-startup-class-01-notes-essay.md Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012
View peter-thiels-cs183-startup-class-01-notes-essay.md

Peter Thiel's CS183: Startup - Class 1 Notes Essay

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

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: {