- What is Democracy? Why Democracy
- Constitutional Design
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Typescript Declaration File for Node Chess module | |
// https://www.npmjs.com/package/chess | |
declare namespace Chess { | |
export function create(opts?: { PGN: boolean }): AlgebraicGameClient | |
export function createSimple(): SimpleGameClient | |
interface AlgebraicGameClient { | |
/** The Game object, which includes the board and move history. */ | |
game: Game |
These are the mandatory window
properties accessed by p5.js
on import, and what can be used instead:
By default, there is no requestAnimationFrame
in node.
p5 has a polyfill for requestAnimationFrame
for older browsers, so we don't need to implement anything.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const w = 400, h = 400 | |
setupWindow(w, h) | |
// import required even though the variable "p5" will not be used anywhere | |
const p5 = require("p5") | |
// Declare sketch variables here | |
function setup() { | |
createCanvas(w, h); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const w = 400, h = 400 | |
setupWindow(w, h) | |
const p5 = require("p5") | |
new p5(p => { | |
// Declare sketch variables here | |
p.setup = () => { | |
p.createCanvas(w, h) | |
// setup function |
(This gist is outdated. This script has been added into the official repo.)
Original Version (old website): https://github.com/CodingTrain/website-archive/blob/main/_scripts/generate-youtube-descriptions.js
This is a draft version of the description generator script to work with the new website.
- Next Video / Previous Video / Playlist
- Base URL: https://editor.p5js.org/
- Only the success responses are mentioned below. For each of the following, in case of an error, an error message will be present in the response, in the format
{
"message": "error message"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MouseDrag - movable canvas | |
// p5.js | |
// function draw() | |
// translate(offset) | |
// .. | |
// } | |
function mouseDragged(event) { | |
offset.add(event.movementX * 0.9, event.movementY * 0.9) |
OlderNewer