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 lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Getting Started with ml5.js</title> | |
<!-- p5 --> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/p5.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.dom.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.9.0/addons/p5.sound.min.js"></script> | |
<!-- ml5 --> |
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
#!/usr/bin/env bash | |
# Modified from: | |
# https://github.com/jacobalberty/unifi-docker/blob/master/import_cert | |
echo "Loading constants" | |
DATADIR="/usr/lib/unifi/data" | |
CERTDIR="/ssl" | |
CERTNAME="fullchain.pem" |
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
/** | |
* Gets all the prime factors of a given number. | |
* @param {number} number for which to get all prime factors. | |
* @param {!Array<number>=} allDivisors List of all prime factors. | |
* This parameter is not meant to be sent when called by a user, but | |
* it is used for the recursive nature of the implementation. | |
*/ | |
const getPrimeFactors = (number, allDivisors = []) => { | |
if (number < 2) throw new Error('getPrimeFactors only accepts numbers greater than 1.'); | |
const maxDivisor = Math.ceil(Math.sqrt(number)); |
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
/** | |
* @typdef {{ | |
* r: number, | |
* g: number, | |
* b: number | |
* }} | |
*/ | |
let Color; | |
/** |
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
/** | |
* @fileoverview Shuffles a YouTube playlist on every run. | |
* | |
* Note: currently this only supports up to 50 videos, but you can extend it to | |
* support more by combining the pages into one. | |
* | |
* This code is meant to be run on Google Apps Script. To get started with | |
* YouTube API on Apps Script and add the YouTube service, read this article: | |
* https://developers.google.com/apps-script/guides/services/advanced | |
*/ |
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 MIN_INT = 1; | |
const MAX_INT = 5; | |
const ROUNDS = 1000; | |
const FLOATING_ACCURACY = 2; | |
function getRandomInt(min = MIN_INT, max = MAX_INT){ | |
min = Math.ceil(min); | |
max = Math.floor(max); | |
return Math.floor(Math.random() * (max - min + 1)) + min; | |
} |
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
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// https://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, | |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
// See the License for the specific language governing permissions and |
OlderNewer