Skip to content

Improve content test for videoId field #1656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions content-testing/schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ const baseVideosSchema = strictObject({
title: string().required(),
description: string().required(),

videoId: youtubeIdValidator.when(['parts'], (parts, schema) => {
videoId: youtubeIdValidator.when('parts', ([parts], schema) => {
// videoId required if the `parts` array is missing or empty
return parts && parts.length > 0 ? schema : schema.required();
return parts && parts.length > 0
? schema.test(
'videoId and parts conflict',
'Top-level "videoId" should not be defined if "parts" exist',
(value) => value === undefined
)
: schema.required();
}),

nebulaSlug: nonUrlStringValidator,
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/10-dfs-maze-generator/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Maze Generator",
"description": "Choo choo! In this multi-part coding challenge, I create a maze generator using a depth-first search algorithm with recursive backtracking. The idea is to walk through a grid of cells, removing walls as we go to build a maze.",
"videoNumber": "10",
"videoId": "",
"date": "2016-05-02",
"languages": ["p5.js", "JavaScript"],
"topics": ["maze", "recursion", "backtracking", "depth-first search"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Neuroevolution Flappy Bird",
"description": "In this challenge, I use my JavaScript neural network library and a genetic algorithm to train an agent to play Flappy Bird.",
"videoNumber": "100",
"videoId": "c6y21FkaUqw",
"date": "2018-04-16",
"languages": ["JavaScript", "p5.js"],
"topics": ["neural network", "reinforcement learning", "genetic algorithms", "evolution", "Flappy Bird game"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/110-recamans-sequence/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Recamán's Sequence",
"description": "In this coding challenge, I visualize the Recamán’s number sequence using the p5.js library and go on to generate a series of musical tones using p5.js sound.",
"videoNumber": "110",
"videoId": "",
"date": "2018-07-24",
"languages": ["p5.js", "JavaScript"],
"topics": ["number sequence", "Recamán's sequence", "music", "audio-visual", "visualization"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/121-logo-interpreter/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Logo Interpreter",
"description": "In this coding challenge, I discuss turtle graphics and make a Logo Interpreter in JavaScript.",
"videoNumber": "121",
"videoId": "",
"date": "2018-10-31",
"languages": ["p5.js", "JavaScript"],
"topics": ["Logo", "Logo interpreter", "turtle graphics"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/122-quick-draw/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Quick, Draw!",
"description": "In this multi-part coding challenge, I take a closer look at the Quick, Draw! dataset and create a simple node API to \"replay\" drawings of rainbows and cats using p5.js.",
"videoNumber": "122",
"videoId": "",
"date": "2018-11-19",
"languages": ["p5.js", "Node.js", "JavaScript"],
"topics": ["Quick, Draw! game", "machine learning (ML)", "doodle classifiers", "sketch-RNN"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/123-chaos-game/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Chaos Game",
"description": "In this multi-part coding challenge, I visualize the \"Chaos Game\".",
"videoNumber": "123",
"videoId": "",
"date": "2018-11-29",
"languages": ["p5.js", "JavaScript"],
"topics": ["chaos game", "fractal", "seed points", "probability"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Drawing with Fourier Transform and Epicycles",
"description": "In this coding challenge, I implement the Discrete Fourier Transform algorithm in JavaScript and render a drawing using epicycles derived from the transform.",
"videoNumber": "130",
"videoId": "MY4luNgGfms",
"date": "2019-01-24",
"languages": ["JavaScript", "p5.js"],
"topics": ["Fourier transform square wave", "discrete Fourier transform", "epicycles drawing"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/134-heart-curve/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Heart Curve",
"description": "In this multi-part challenge, I use a parametric equation (from Wolfram Mathworld) to draw a heart curve in Processing (Java).",
"videoNumber": "134",
"videoId": "",
"date": "2019-02-18",
"languages": ["Processing"],
"topics": ["heart curve", "parametric equation", "polar coordinates", "GIF loop"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/136-polar-noise-loops/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Polar Noise Loops",
"description": "In this multi-part coding challenge I show how to use a noise field and polar coordinates to create a perfect GIF loop.",
"videoNumber": "136",
"videoId": "",
"date": "2019-02-25",
"languages": ["p5.js", "Processing"],
"topics": ["GIF loop", "Perlin noise", "polar coordinates"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/142-rubiks-cube/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Rubik's Cube",
"description": "Can I build an interactive 3D Rubik's cube in Processing? Yes! Someday I hope to return to this project and add an AI solver!",
"videoNumber": "142",
"videoId": "",
"date": "2019-04-01",
"languages": ["Processing"],
"topics": ["Rubik's cube", "rotation matrix", "peasyCam", "simulation"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/32-agario/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Agar.io",
"description": "In this multi-part coding challenge, I create a clone of the multiplayer online game Agar.io with JavaScript, node.js and websockets.",
"videoNumber": "32",
"videoId": "",
"date": "2016-08-16",
"languages": ["JavaScript", "Node.js"],
"topics": ["agar.io", "WebSocket"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Traveling Salesperson",
"description": "In Part 1 of this multi-part coding challenge, I introduce the classic computer science problem of the Traveling Salesperson (TSP) and discuss the pitfalls with a brute force solution. In Part 2, I discuss Lexicographic Ordering and demonstrate one algorithm to iterate over all the permutations of an array. In Part 3, I apply this algorithm to a brute-force solution of the TSP problem. Every single route permutation is checked one by one. In Part 4, I attempt to create a solution to the TSP problem with a genetic algorithm, and then I add a “crossover” algorithm in Part 5.",
"videoNumber": "35",
"videoId": "BAejnwN4Ccw",
"date": "2016-08-24",
"languages": ["p5.js"],
"topics": [
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/40-word-counter/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Word Counter",
"description": "In this challenge, we build a word counting (concordance) application, and visualize the frequency of each word using variable font size! We also implement the TF-IDF algorithm",
"videoNumber": "40",
"videoId": "",
"date": "2016-10-10",
"languages": ["p5.js", "Processing", "JavaScript", "Java"],
"topics": ["word counting", "visualization", "tf-idf"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Markov Chain Name Generator",
"description": "In this multi-part coding challenge I attempt to use a Markov Chain to generate a new name for my YouTube channel.",
"videoNumber": "42",
"videoId": "",
"date": "2016-10-24",
"languages": ["JavaScript", "p5.js"],
"topics": ["Markov chain", "n-gram", "text generator"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "AFINN-111 Sentiment Analysis",
"description": "In this multi-part coding challenge I implement sentiment analysis using the AFINN-111 word list.",
"videoNumber": "44",
"videoId": "",
"date": "2016-12-01",
"languages": ["JavaScript", "p5.js"],
"topics": ["sentiment analysis", "AFINN-111"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/46-asteroids/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Asteroids",
"description": "In this two part coding challenge, I use the p5.js library to create my own version of the classic Atari video game Asteroids!",
"videoNumber": "46",
"videoId": "",
"date": "2016-12-15",
"languages": ["p5.js", "JavaScript"],
"topics": ["Atari Asteroids game", "polar to Cartesian coordinates"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Circle Packing",
"description": "In this multi-part coding challenge, I demonstrate how to use a circle packing algorithm.",
"videoNumber": "50",
"videoId": "",
"date": "2017-01-09",
"languages": ["Processing"],
"topics": ["circle packing", "pixels"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "A* Pathfinding Algorithm",
"description": "In this multi-part coding challenge, I attempt an implementation of the A* Pathfinding Algorithm to find the optimal path between two points in a 2D grid.",
"videoNumber": "51",
"videoId": "",
"date": "2017-01-16",
"languages": ["p5.js", "JavaScript"],
"topics": ["A* algorithm", "pathfinding", "heuristic"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Islamic Star Patterns",
"description": "In this bonus super-sized coding challenge, I work through visualizing Islamic Star Patterns in p5.js.",
"videoNumber": "54",
"videoId": "",
"date": "2017-02-01",
"languages": ["p5.js", "JavaScript"],
"topics": ["Islamic star patterns", "Hankin's method", "tile pattern", "law of sines"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Plinko with Matter.js",
"description": "I love all things random and chance so why not make a Plink simulation with the matter.js physics engine and p5.js!",
"videoNumber": "62",
"videoId": "KakpnfDv_f0",
"date": "2017-03-10",
"languages": ["JavaScript", "p5.js", "Matter.js"],
"topics": ["collision detection", "matter.js", "physics engine", "Plinko game"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Texturing Cloth Simulation",
"description": "In this two part challenge, I cover beginShape(), endShape(), and texture(), TRIANGLE_STRIP, QUAD_STRIP, and more. I combine these geometry functions with the Toxiclibs physics library to simulate a waving flag (with a unikitty image texture!)",
"videoNumber": "63",
"videoId": "",
"date": "2017-03-14",
"languages": ["Processing", "Java"],
"topics": ["physics engine", "texture 3D", "Toxiclibs", "cloth", "simulation"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/64-kinematics/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Kinematics",
"description": "In this multi-part coding challenge, I demonstrate how to implement kinematics in Processing (Java).",
"videoNumber": "64",
"videoId": "xXjRlEr7AGk",
"date": "2017-03-16",
"languages": ["Processing"],
"topics": ["forward kinematics", "inverse kinematics", "tentacle animation", "linked lists", "array"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/65-binary-tree/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Binary Tree",
"description": "This multi-part coding challenge is part of the first week of my course: \"Intelligence and Learning.\" Here I attempt to implement a classic data structure: The Binary Search Tree.",
"videoNumber": "65",
"videoId": "ZNH0MuQ51m4",
"date": "2017-03-21",
"languages": ["JavaScript", "p5.js"],
"topics": ["tree", "binary search", "data structure", "intelligence and learning"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Breadth-First Search",
"description": "In this two part challenge, I implement the Breadth-First Search algorithm in JavaScript. My demo application is \"6 Degrees of Kevin Bacon\" (finding the closest relationship between Kevin Bacon and another actor).",
"videoNumber": "68",
"videoId": "piBq7VD0ZSo",
"date": "2017-03-30",
"languages": ["JavaScript", "p5.js"],
"topics": ["breadth-first search algorithm", "Six Degrees of Kevin Bacon"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Evolutionary Steering Behaviors",
"description": "In this multi-part coding challenge, I create a system where autonomous steering agents evolve the behavior of eating food and avoiding poison.",
"videoNumber": "69",
"videoId": "flxOkx0yLrY",
"date": "2017-04-18",
"languages": ["JavaScript", "p5.js"],
"topics": ["genetic algorithms", "steering behaviors", "seek function", "autonomous agent", "evolution"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Nearest Neighbors Recommendation Engine",
"description": "In this multi-part coding challenge, I create a movie recommendation engine using the \"nearest neighbor\" algorithm.",
"videoNumber": "70",
"videoId": "",
"date": "2017-05-09",
"languages": ["p5.js", "JavaScript"],
"topics": ["nearest neighbors", "similarity score", "Euclidean distance", "associative arrays"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/72-frogger/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Frogger",
"description": "In this multi-part challenge, I create a simplified version of the classic Atari video game Frogger in Processing (Java).",
"videoNumber": "72",
"videoId": "giXV6xErw0Y",
"date": "2017-06-14",
"languages": ["Processing"],
"topics": ["game mechanics", "Atari Frogger game", "inheritance"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/81-circle-morphing/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Circle Morphing",
"description": "In this multi-part challenge, I implement two possible solutions to Golan Levin's Circle Morphing challenge.",
"videoNumber": "81",
"videoId": "u2D4sxh3MTs",
"date": "2017-11-01",
"languages": ["JavaScript", "p5.js"],
"topics": ["Golan Levin", "interpolation", "circle morphing", "polar coordinates"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/91-snakes-and-ladders/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Snakes & Ladders",
"description": "In this multi-part coding challenge, I attempt to create a simulation of the classic board game Snakes & Ladders (also known as Chutes and Ladders).",
"videoNumber": "91",
"videoId": "",
"date": "2018-01-29",
"languages": ["p5.js", "JavaScript"],
"topics": ["Snakes & ladders game", "games"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/94-2048/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "2048 Sliding Puzzle Game",
"description": "In this multi-part coding challenge, I code the sliding puzzle game 2048 in JavaScript using canvas and p5.js.",
"videoNumber": "94",
"videoId": "JSn-DJU8qf0",
"date": "2018-02-26",
"languages": ["JavaScript", "p5.js"],
"topics": ["2048 game", "sliding puzzle game"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/97-book-of-pi/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "The Book of Pi",
"description": "In yet another “Pi Day” coding challenge, I attempt to generate a pdf “Book of Pi” with the first 10 million digits of Pi mapped to color. Processing (Java) is used for this project.",
"videoNumber": "97",
"videoId": "",
"date": "2018-03-20",
"languages": ["Processing", "Java"],
"topics": ["Pi", "Pi day", "visualization"],
Expand Down
1 change: 0 additions & 1 deletion content/videos/challenges/98-quadtree/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Quadtree",
"description": "In this multi-part coding challenge, I implement a Quadtree data structure in JavaScript and visualize it with p5.js.",
"videoNumber": "98",
"videoId": "OJxEcs0w_kE",
"date": "2018-03-26",
"languages": ["JavaScript", "p5.js"],
"topics": ["quadtree data structure", "quadtree collision detection"],
Expand Down
6 changes: 3 additions & 3 deletions gatsby/createSchemaCustomization.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const schema = /* GraphQL */ `
id: ID!
title: String!
slug: String!
videoId: String!
videoId: String
description: String!
date: String
videoNumber: String
Expand All @@ -32,7 +32,7 @@ const schema = /* GraphQL */ `
id: ID!
title: String!
slug: String!
videoId: String!
videoId: String
description: String!
date: String
videoNumber: String
Expand All @@ -58,7 +58,7 @@ const schema = /* GraphQL */ `
id: ID!
title: String!
slug: String!
videoId: String!
videoId: String
description: String!
date: String
videoNumber: String
Expand Down
Loading