Skip to content

Instantly share code, notes, and snippets.

@vmaliwal
vmaliwal / sol-lewitt-sketch-0.md
Last active July 27, 2020 02:23
Sol Lewitt's Square Art recreated in JavaScript
export default function Sketch(p5) {
  p5.setup = () => {
    p5.createCanvas(300, 300);
    p5.noFill();
    p5.noLoop();
  };

  p5.draw = () => {
    p5.background(0);
@vmaliwal
vmaliwal / system_design_numbers_cheat_sheet.md
Last active August 30, 2023 17:43 — forked from mwakaba2/system_design_numbers_cheat_sheet.md
Updated easy to remember system design numbers for back-of-the-envelope calculations
@vmaliwal
vmaliwal / sketch.js
Last active November 2, 2019 11:43
A super simple canvas
(() => {
// get canvas by id
// get canvas by id
const canvas = document.querySelector("#myCanvas")
// overriding default width & height
canvas.width = 500
canvas.height = 500
// get 2d context of our canvas
@vmaliwal
vmaliwal / index.html
Last active October 23, 2019 11:58
Super simple canvas index file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Super Simple Canvas</title>
<script src="sketch.js"></script>
</head>
<body>
<canvas id="myCanvas" height="500" width="500"></canvas>
</body>
@vmaliwal
vmaliwal / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console