- Go to https://github.com.
- Click on Sign Up and follow all steps to create an account.
- Click on button New (like in screenshot #1)
#!/usr/bin/env ruby | |
# | |
# JavaScript Soundfont Builder for MIDI.js | |
# Author: 0xFE <[email protected]> | |
# edited by Valentijn Nieman <[email protected]> | |
# | |
# 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 |
function mapLimit (col, limit, mapFunc, doneFunc, newCol = [], index = { value: 0 }, freeThreads = { value: limit }) { | |
if (freeThreads.value > 0 && index.value < col.length) { | |
// Save current index | |
const curIndex = index.value | |
// Now the number of free threads is lower on 1 | |
freeThreads.value -= 1 | |
mapFunc((err, newItem) => { | |
if (err) { | |
// Smth bad happend, we call doneFunc with err |