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
// Create a hash table | |
const hash = (key, size) => { | |
let hashedKey = 0; | |
for (let i = 0; i < key.length; i++) { | |
hashedKey += key.charCodeAt(i); | |
} | |
return hashedKey % size; |
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
let ctx = new AudioContext(); | |
let osc = ctx.createOscillator(); | |
osc.connect(ctx.destination); | |
osc.start(); | |
window.onmousemove = event => { | |
document.body.style.backgroundColor = `hsl(${event.clientX}, 60%, 60%)`; |
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
import React, { useState, useEffect } from "react"; | |
import "./App.css"; | |
let useRedditImages = (query) => { | |
let [images, setImages] = useState([]) | |
useEffect(() => | |
fetch( | |
`https://www.reddit.com/r/aww/search.json?q=${ | |
query | |
}&restrict_sr=1` |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} | |
</style> | |
</head> |