1. Create account on GitHub
- Go to https://github.com.
- Click on Sign Up and follow all steps to create an account.
2. Create a project for your site
- Click on button New (like in screenshot #1)
![]() |
VOOZH | about |
Instantly share code, notes, and snippets.
| # Fetch and map JSON in different frameworks |
| ## React: |
| ```jsx |
| import React, { useEffect, useState } from 'react'; |
| function App() { |
| const [data, setData] = useState([]); |
| #!/usr/bin/env ruby |
| # |
| # JavaScript Soundfont Builder for MIDI.js |
| # Author: 0xFE <mohit@muthanna.com> |
| # edited by Valentijn Nieman <valentijnnieman@gmail.com> |
| # |
| # Requires: |
| # |
| # FluidSynth |
| # Lame |
| const keys = [ 'a', 'b', 'c' ] |
| const values = [ 1, 2, 3 ] |
| const map = {} |
| keys.forEach((k, i) => { map[k] = values[i] }) |
| // Based on this excellent article (https://apoorvaj.io/cubic-bezier-through-four-points/) |
| const vectorLength = (p1, p2) => { |
| return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2)) |
| } |
| const middleCurvePoints = (firstPoint, secondPoint, thirdPoint, fourthPoint, alpha, epsilon) => { |
| const d1 = Math.pow(vectorLength(secondPoint, firstPoint), alpha) |
| const d2 = Math.pow(vectorLength(thirdPoint, secondPoint), alpha) |
| const d3 = Math.pow(vectorLength(fourthPoint, thirdPoint), alpha) |
| 'use strict' |
| // based on the same code in python https://gist.github.com/internetimagery/642b9cfa8488ba9a4d7c |
| const boundsOfCurve = (x0, y0, x1, y1, x2, y2, x3, y3) => { |
| const tvalues = [] |
| const bounds = [[], []] |
| const points = [] |
| for (let i = 0; i <= 1; i++) { |
| let b |
| interface User { |
| String name(); |
| int age(); |
| } |
| class SimpleUser implements User { |
| private String name; |
| private int age; |
| //...constructor |
| String name () { |
| class User { |
| private String name; |
| private int age; |
| // ... constructor |
| public String name() { |
| return this.name; |
| } |
| function foo() { |
| console.error('foo'); |
| } |
| process.nextTick(foo); |
| console.error('bar'); |
| console.error('bar'); |
| process.nextTick(foo); |
| console.error('bar'); |
| class TreeNode { |
| constructor (value, left, right) { |
| this.value = value |
| this.left = left |
| this.right = right |
| } |
| invert () { |
| if (!this.left && !this.right) { |
| return this |