Add these lines in your ~/.bashrc
file
# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
import React, { useState } from "react"; | |
import styled from "styled-components"; | |
import Message from "./Message"; | |
const FormContainer = styled.div` | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
margin-top: 100px; | |
`; |
const fetchResource = () => fetch('https://pokemons.com').then(r => r.json()) | |
const state = useState(fetchResource); | |
if (state.promised) { | |
return <p>Loading {resourcePath}</p>; | |
} | |
if (state.error) { | |
return (<p> | |
Failed to load {resourcePath} |
import { Persistence } from '@hookstate/persistence'; | |
import { createState, useState, none } from '@hookstate/core' | |
const store = createState({ | |
pokemon: { name: '', power: '', description: '' }, | |
pokemons: [{ id: 1, name: 'pikachu', power: 'fire', description: 'fluffy' }], | |
isEditing: false, | |
}) | |
const useGlobalState = () => { |
import useGlobalState from "../store" | |
import { List, ListItem, ListIcon, ListContent, ListHeader, ListDescription, Segment } from 'semantic-ui-react' | |
function Row({ id, name, power, description, selectPokemon, deletePokemon }) { | |
return ( | |
<ListItem> | |
<ListIcon name="trash alternate outline" onClick={() => deletePokemon(id)}></ListIcon> | |
<ListIcon name="edit outline" onClick={() => selectPokemon({ id, name, power, description })}></ListIcon> | |
<ListContent> | |
<ListHeader as="h3">{name}</ListHeader> |
import { useEffect } from "react"; | |
import { useState } from '@hookstate/core'; | |
import useGlobalState from "../store" | |
import { Form, FormField, Header, Input, Button, Segment } from 'semantic-ui-react' | |
const initialState = { name: '', power: '', description: '' } | |
function PokemonForm() { | |
const state = useGlobalState(); |
# Where is the location of your current shall. Useful if we need to revert | |
echo $0 | |
# Install ZSH | |
sudo apt-get install zsh | |
# Instal GIT | |
sudo apt-get install git-core | |
# Install OhMyZSH |
// Redux action | |
export function uploadSuccess({ data }) { | |
return { | |
type: 'UPLOAD_DOCUMENT_SUCCESS', | |
data, | |
}; | |
} | |
export function uploadFail(error) { | |
return { |
import express from 'express'; | |
import axios from 'axios'; | |
import multer from 'multer'; | |
const app = express(); | |
/** | |
... express.js boilerplate | |
routes, middlewares, helpers, loggers, etc | |
**/ |