This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {PropTypes} from 'react' | |
import { clearError } from '../../actions' | |
import { connect } from 'react-redux' | |
export const ShowErrors = ({errors = [], onClearError = f => f}) => | |
<div className = "show-errors" > {(errors.length) | |
? errors.map((message, i) => | |
<div key={i} className="error"> | |
<p>{message}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* How to use em document wide | |
em sized fonts are based off of the size of the root level font size. | |
If you change the root font size that cascades document wide | |
By setting the size to 62.5% we can achieve the 16px default browser | |
size while making em sizing more understandable (16 * 62.5% = 10) | |
Now 1.6em = 16px */ | |
body { | |
font-size: 62.5%; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* How to use em document wide | |
em sized fonts are based off of the size of the root level font size. | |
If you change the root font size that cascades document wide | |
By setting the size to 62.5% we can achieve the 16px default browser | |
size while making em sizing more understandable (16 * 62.5% = 10) | |
Now 1.6em = 16px */ | |
body { | |
font-size: 62.5%; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use using to declare namespaces and functions we wish to use | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using AnimalNS; | |
/* | |
Multiline Comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delete mdf file in app-data | |
Press CTRL-SHIFT-B to build the project. | |
In Package Manager console type: Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDBContext | |
Enter and await confirmation | |
This creates a Configuration.cs file in Migrations folder | |
Add Seed data to this file. | |
Press CTRL-SHIFT-B to build the project. | |
add-migrations +Name | |
update-database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add prop to Model Class | |
Build | |
Update Bindings in Controller class | |
Update views | |
Update seed data | |
Build | |
add-migration +name | |
build again | |
update database | |
Run as normal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
****example****** | |
public class Movie | |
{ | |
public int ID { get; set; } | |
[StringLength(60, MinimumLength = 3)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:7-alpine | |
RUN mkdir -p /src/app | |
WORKDIR /src/app | |
COPY package.json /src/app/package.json | |
RUN npm install | |
COPY . /src/app | |
EXPOSE 3000 | |
CMD [ "npm", "start"] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react", "import"], | |
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:import/errors","plugin:import/warnings"], | |
"parserOptions": { | |
"ecmaVersion": 6, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
import {AUTH_USER, UNAUTH_USER, AUTH_ERROR} from './types'; | |
import authError from './error'; | |
const ROOT_URL = 'http://localhost:3000/'; // url to api | |
export default function signinUser(email,password) { |