Skip to content

Instantly share code, notes, and snippets.

View stoneboyindc's full-sized avatar

Nick Chang stoneboyindc

View GitHub Profile
'use strict';
module.exports = (sequelize, DataTypes) => {
var WikiCollaborators = sequelize.define('WikiCollaborators', {
wikiId: {
type: DataTypes.INTEGER,
allowNull: false
},
userId: {
type: DataTypes.INTEGER,
allowNull: false
ReferenceError: /Users/nickchang/work/thinkful/tc/jennjwill/blocipedia-node/src/views/users/upgrade.ejs:23
21| src="https://checkout.stripe.com/checkout.js"
22| class="stripe-button"
>> 23| data-key="<%=PUBLISHABLE_KEY%>"
24| data-amount="1500"
25| data-name="Demo Site"
26| data-description="Blocipedia Premium Membership"
PUBLISHABLE_KEY is not defined
at eval (eval at compile (/Users/nickchang/work/thinkful/tc/jennjwill/blocipedia-node/node_modules/ejs/lib/ejs.js:633:12), <anonymous>:97:25)
@stoneboyindc
stoneboyindc / error
Created October 1, 2019 17:37
http://localhost:3000/topics/6
SyntaxError: Missing catch or finally after try in C:\code\thinkful\tc\laynet\bloccit\src\views\topics\show.ejs while compiling ejs
If the above error is not helpful, you may want to try EJS-Lint:
https://github.com/RyanZim/EJS-Lint
at new Function (<anonymous>)
at Template.compile (C:\code\thinkful\tc\laynet\bloccit\node_modules\ejs\lib\ejs.js:549:12)
at Object.compile (C:\code\thinkful\tc\laynet\bloccit\node_modules\ejs\lib\ejs.js:358:16)
at handleCache (C:\code\thinkful\tc\laynet\bloccit\node_modules\ejs\lib\ejs.js:201:18)
at tryHandleCache (C:\code\thinkful\tc\laynet\bloccit\node_modules\ejs\lib\ejs.js:223:14)
at View.exports.renderFile [as engine] (C:\code\thinkful\tc\laynet\bloccit\node_modules\ejs\lib\ejs.js:437:10)
@stoneboyindc
stoneboyindc / show.ejs
Created October 1, 2019 18:01
Try this one.
<!DOCTYPE html>
<html>
<head>
<% include ../static/partials/head.ejs %>
</head>
<body>
<% include ../static/partials/navbar.ejs %>
<main class="container">
<h1><%= topic.title %></h1>
nickchang@Nicks-MacBook-Pro:~/work/thinkful/tc/preet-singh/preet-bookmarks-server$ npm test
> express-boilerplate@1.0.0 test /Users/nickchang/work/thinkful/tc/preet-singh/preet-bookmarks-server
> mocha --require test/setup.js
App
::ffff:127.0.0.1 - - [04/Oct/2019:00:47:23 +0000] "GET / HTTP/1.1" 200 6
✓ GET / responds with 200 containing "Hello, world!"
@stoneboyindc
stoneboyindc / bookmarks-endpoints.spec
Created October 4, 2019 00:59
bookmarks-endpoints.spec.js
'use strict';
const { expect } = require('chai');
const knex = require('knex');
const app = require('../src/app');
const { makeBookmarksArray } = require('./bookmarks.fixtures');
describe('Bookmarks Endpoints', () => {
let db;
before('make knex instance', () => {
@stoneboyindc
stoneboyindc / posts_spec.js
Created October 8, 2019 16:11
Try this version
const request = require("request");
const server = require("../../src/server");
const base = "http://localhost:3000/topics";
const sequelize = require("../../src/db/models/index").sequelize;
const Topic = require("../../src/db/models").Topic;
const Post = require("../../src/db/models").Post;
const User = require("../../src/db/models").User;
describe("routes : posts", () => {
const divide = require('../index');
const sort = require('../sort');
const expect = require('chai').expect;
describe('Divide function', () => {
it('should divide positive integers correctly', () => {
const a = 8;
const b = 4;
const expectedAnswer = 2;
nickchang@Nicks-MacBook-Pro:~/work/thinkful/tc/ajiles91/full-stack-capstone$ npm start
> full-stack-capstone@0.1.0 start /Users/nickchang/work/thinkful/tc/ajiles91/full-stack-capstone
> react-scripts start
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'is-descriptor'