Skip to content

Instantly share code, notes, and snippets.

/*
Assume that `colors` in the function below will look something like the following:
[ 'Red', 'Yellow', 'White' ];
*/
// Require `addColorToPlant` here.
let addColorToPlant=require("./plants.js");
function generateRosesByColor(colors) {
let result = [];
/*
In the following function, assume plant is an object.
*/
function addColorToPlant(plant, color) {
plant.color = color;
return plant;
}
// Export `addColorToPlant` here.
module.exports = addColorToPlant;
module.exports = {
API_ENDPOINT: 'https://localhost:3000/',
API_KEY: process.env.REACT_APP_API_KEY,
API_DEV_ENDPOINT :'http://localhost:8000/',
}
import React, {Component} from 'react';
import {Link } from 'react-router-dom'
import ApiContext from '../ApiContext';
import './MyCloset.css'
import NewItemButton from '../NewItemButton/NewItemButton';
import {getClosetItems} from '../items-helpers';
import Item from '../Item/Item';
import TokenService from '../services/token-service';
import config from '../config';
function findMyCampsites (campgrounds, viewToMatch, partySizeToMatch){
let dreamSite =[];
let sorryMessage = "Sorry, no campsites with that view are available to host your party";
for (let i = 0; i< campgrounds.length; i++){
if (campgrounds[i].isReserved === false &&
campgrounds[i].view === viewToMatch &&
campgrounds[i].partySize >= partySizeToMatch){
dreamSite.push(campgrounds[i].number);
}
import React from "react";
import Option from "../Option/Option";
import Total from "../Total/Total";
export default function MainSummary(props) {
const { USCurrencyFormat } = props;
const summary = Object.keys(props.selected).map((feature, idx) => {
const featureHash = feature + "-" + idx;
const selectedOption = props.selected[feature];
import React from "react";
export default function Option(props) {
const { USCurrencyFormat } = props;
return (
<div className="summary__option" key={props.featureHash}>
<div className="summary__option__label">{props.feature}</div>
<div className="summary__option__value">{props.selectedOption!=null && props.selectedOption.name}</div>
<div className="summary__option__cost">
import React from "react";
import Option from "../Option/Option";
import Total from "../Total/Total";
export default function MainSummary(props) {
const { USCurrencyFormat } = props;
const summary = Object.keys(props.selected).map((feature, idx) => {
const featureHash = feature + "-" + idx;
const selectedOption = props.selected[feature];
C:\code\thinkful\tc\AJVDV\blogful-api>npm run test
> blogful-api@1.0.0 test C:\code\thinkful\tc\AJVDV\blogful-api
> mocha --require test/setup.js
App
::ffff:127.0.0.1 - - [17/Dec/2020:16:36:36 +0000] "GET / HTTP/1.1" 200 13
√ GET / responds with 200 containing "Hello, world!" (53ms)
@peaceintheheart
peaceintheheart / gist:07273cf10ba3b028354d0abd75ff420e
Created December 16, 2020 16:23
Correct the migration scripts
// 006
CREATE TABLE payment_summaries (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
course_id INTEGER REFERENCES bootcamp_courses(id),
monthly FLOAT,
up_front FLOAT,
interest_only_loan TEXT,
immediate_repayment_loan TEXT,
isa TEXT