Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Chang stoneboyindc

View GitHub Profile
View It works here.
C:\code\thinkful\tc\jonathanbutler7\blogful-api-auth>npm run migrate
> blogful-api-auth@0.0.1 migrate C:\code\thinkful\tc\jonathanbutler7\blogful-api-auth
> postgrator --config postgrator-config.js
[12:28:01 PM] table schemaversion does not exist - creating it.
[12:28:01 PM] version of database is: 0
[12:28:01 PM] migrating up to 4
[12:28:02 PM] running 001.do.create_blogful_articles.sql
[12:28:02 PM] running 002.do.alter_article_style.sql
View error
C:\code\thinkful\tc\beccahudson\rebecca-virtual-desk-server>npm run migrate
> virtual-desk-server@1.0.0 migrate C:\code\thinkful\tc\beccahudson\rebecca-virtual-desk-server
> postgrator --config postgrator-config.js
Package pg version 8.x.x not tested
Please raise issue to support pg > 7.x.x
[12:25:18 PM] table schemaversion does not exist - creating it.
[12:25:18 PM] version of database is: 0
[12:25:18 PM] migrating up to 3
View error
C:\code\thinkful\tc\beccahudson\rebecca-virtual-desk-server>npm run migrate
> virtual-desk-server@1.0.0 migrate C:\code\thinkful\tc\beccahudson\rebecca-virtual-desk-server
> postgrator --config postgrator-config.js
Package pg version 8.x.x not tested
Please raise issue to support pg > 7.x.x
[12:25:18 PM] table schemaversion does not exist - creating it.
[12:25:18 PM] version of database is: 0
[12:25:18 PM] migrating up to 3
View loop
let sum = 0;
for (let i=1; i<=10; i++) {
sum = sum + i;
}
View AddFolder.js
import React, { Component } from 'react';
import dataContext from './dataContext';
export default class AddFolder extends Component{
static contextType=dataContext;
handleSubmit=e=>{
e.preventDefault()
const name=e.target.folder;
console.log(name.value,name);
let newFolder = { "name" : name.value};
View Bomb.js
import React from 'react';
export default class Bomb extends React.Component {
constructor(props) {
super(props)
this.state = { count: 0 };
}
componentDidMount() {
this.interval = setInterval(() => {
View NotePage
import React from 'react';
import { NavLink } from 'react-router-dom';
//import FolderList from '../folder-list/folder-list';
//import Note from '../note/note';
import './note-page.css';
export default function NotePage(props) {
const {
note,
id,
View Pass folder into NotePage
<Route
path='/notes/:notesId'
render={(routeProps) =>
<NotePage
note={store.notes.find(note => note.id === routeProps.match.params.notesId)}
folder={store.folders.find(folder => folder.id === (store.notes.find(note => note.id === routeProps.match.params.notesId)).folderId) }
/>
}
/>
View .env
PORT=8000
NODE_ENV='development'
DATABASE_URL='postgresql://ashley2@localhost/noteful'
TEST_DATABASE_URL='postgresql://ashley2@localhost/noteful_test_api'
View note-list.js
import React from 'react';
import Note from '../note/note';
export default function NoteList(props) {
const {
id,
name,
} = props;
return (
You can’t perform that action at this time.