Skip to content

Instantly share code, notes, and snippets.

Nick Chang stoneboyindc

Block or report user

Report or block stoneboyindc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View refactoring
$(function() {
$('#js-shopping-list-form').submit(function(event) {
event.preventDefault();
const item = $('#shopping-list-entry').val();
$('.shopping-list').prepend(
`<li>
<span class ="shopping-item">${item}</span>
<div class="shopping-item-controls">
<button class="shopping-item-toggle">
<span class="button-label">check</span>
View test.html
<!DOCTYPE html>
<html>
<head>
<title>ABBWTEST</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>
<body>
<header>
<div class="container">
<div id="logo">
View app.js
function onReady(){
const addToDoForm = document.getElementById('addToDoForm');
const newToDoText = document.getElementById ('newToDoText');
const toDoList = document.getElementById ('toDoList');
addToDoForm.addEventListener('submit', event => {
event.preventDefault();
// get the text
let title = newToDoText.value;
// create a new li
View Fix line #24
'use strict';
$(function () {
$('#js-shopping-list-form').submit(
function (event) {
event.preventDefault();
const targetItem = $('#shopping-list-entry').val();
const listItemTemplate = (`<li>
<span class="shopping-item">
${targetItem}
View App.test.js
import React from 'react';
import { render } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
View Code fix
// When a user selects one of the answer buttons
function submitAnswer(){
$('.announce-card').on('click', 'button', function(event) {
event.preventDefault();
let selected = event.currentTarget.value;
let correct = STORE[questionNumber].the_correct_answer_is;
if (questionNumber === 0){
correctAnswer();
} else if (questionNumber !== 0) {
if (answer === correct) {
View test result
> express-boilerplate@1.0.0 migrate:test C:\code\thinkful\tc\ksdumont\blogful-api
> env NODE_ENV=test npm run migrate
'env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! express-boilerplate@1.0.0 migrate:test: `env NODE_ENV=test npm run migrate`
npm ERR! Exit status 1
View test result
nickchang@Nicks-MacBook-Pro:~/work/thinkful/tc/sheilajmj/blogful_api$ npm test
> express-boilerplate@1.0.0 test /Users/nickchang/work/thinkful/tc/sheilajmj/blogful_api
> mocha --require test/setup.js
Articles Endpoints
DELETE /articles/:article_id
Given no articles
View main.js
function watchMovieSubmit(event) {
event.preventDefault();
//get the value
const searchBarMovie = $("#titleForm").val();
performMovieSearch(searchBarMovie);
console.log(searchBarMovie);
console.log("test0");
}
function watchActorSubmit(event) {
View This works!
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>React Hello World</title>
</head>
You can’t perform that action at this time.