Skip to content

Instantly share code, notes, and snippets.

View zrod's full-sized avatar
💻
Refactoring https://donating.io

Rodrigo zrod

💻
Refactoring https://donating.io
View GitHub Profile
// @flow
export default class I18n {
translations: {
messages: {},
routes: {}
} = {
messages: {},
routes: {}
};
@zrod
zrod / App.jsx
Last active February 1, 2018 02:10
// ...
export class App extends React.Component
{
static propTypes = {
auth: PropTypes.object.isRequired
};
render() {
// ...
@zrod
zrod / authReducer.js
Created December 2, 2017 17:21
spread operator mess
import authType from './authType';
import { LIKE_POST_SUCCESS } from '../actions/actionTypes';
export default function authReducer(state = authType, action) {
switch (action.type) {
// ...
case types.LIKE_POST_SUCCESS:
return {
...state,
...{
import React, { Component } from 'react';
import { render } from 'react-dom';
import { BrowserRouter as Router , Route, Link } from 'react-router-dom';
import SuperAgent from 'superagent';
class Home extends Component {
render(){
return (
<div className="page-content">TEST
</div>);
@zrod
zrod / Pousada.js
Last active November 2, 2017 02:11
ng-4 - Cannot read property 'title' of undefined
export class Pousada {
slug: string;
title: string;
location: string;
lat: string;
long: string;
images: {
main: string
};
}
// object structure
{
id: '57dce89f84bec9ff038b456d',
slug: 'toronto',
country: {
id: '564e85d284bec915048b4568'
},
views: 14,
comments: [
{
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Link } from 'react-router';
import moment from 'moment';
import { Button, Comment, Form, Header, Message, Divider } from 'semantic-ui-react';
import { sprintf } from 'sprintf-js';
import * as validationRules from '../../../resources/ValidationRules';
import I18n from '../../../helpers/I18n';
<div>
<h1>{{pousada.title}}</h1>
<small>{{pousada.location}}</small>
<iframe
width="600"
height="450"
frameborder="0" style="border:0"
src="https://www.google.com/maps/embed/v1/place?key={{googleMapsKey}}
&q=Space+Needle,Seattle+WA" allowfullscreen
@zrod
zrod / gist:4251777
Created December 10, 2012 16:54
"Replace" master with another branch
In the unfortunate case where a branch other than master is often used - or becomes the new "master" - and a replacement of master with it is required, execute the following codes:
git checkout branchie
git merge -s ours master
git checkout master
git merge branchie
import { Component } from '@angular/core'
@Component({
selector: 'app',
template: `
<div>
<h2>Hello {{name}}</h2>
</div>
`,
})