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
grunt-contrib-watch grunt-contrib-clean grunt-contrib-uglify grunt-contrib-jshint grunt-contrib-copy grunt-contrib-concat grunt-contrib-connect grunt-contrib-cssmin grunt-contrib-sass grunt-contrib-less grunt-contrib-requirejs grunt-contrib-imagemin grunt-contrib-htmlmin grunt-contrib-coffee grunt-contrib-compass grunt-contrib-compress grunt-contrib-csslint grunt-contrib-jasmine grunt-contrib-nodeunit grunt-contrib-qunit grunt-contrib-handlebars grunt-contrib-jade grunt-contrib-jst grunt-contrib-stylus grunt-contrib-yuidoc grunt-contrib-symlink grunt-contrib-livereload grunt-contrib-rename grunt-contrib-testem grunt-assemble-less grunt-contrib grunt-contrib-jshint-jsx grunt-jquery-content grunt-contrib-mincss grunt-contrib-jasmine-phantom grunt-contrib-serverify-ts grunt-contrib-haml grunt-contrib-kraken grunt-ks-stylus grunt-license-report grunt-process-includes grunt-transfo grunt-contrib-concat-sourcemaps grunt-contrib-gotohead grunt-qc-concat grunt-croc-qunit grunt-contrib-bobtail grunt-git-contributors g |
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
function set_translate(e, pix) { | |
e.style["-webkit-transform"] = "translate(0px, "+ pix +"px)"; | |
e.style["-moz-transform"] = "translate(0px, -" + pix +"px)"; | |
e.style["-ms-transform"] = "translate(0px, -" + pix + "px)"; | |
e.style["-o-transform"] = "translate(0px, " + pix + "px)"; | |
e.style["transform"] = "translate(0px, -" + pix + "px)"; | |
} |
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
// step 1. create an element with the class of "message" | |
// Step 2. Insert the code below in a file or script tag | |
var message = document.querySelector('.message'); | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", "http://numbersapi.com/random"); | |
xhr.onload = function (e) { | |
if (xhr.readyState === 4) { | |
if (xhr.status === 200) { | |
message.innerHTML = xhr.responseText; |
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
.module--link | |
text-decoration: none | |
font-weight: bold | |
color: $primary | |
position: relative | |
&:before | |
content: "" | |
position: absolute | |
width: 100% |
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
// Function used to get best fit. See http://www.varsitytutors.com/hotmath/hotmath_help/topics/line-of-best-fit.html for formula | |
function LOBF(data, xiden, yiden) { | |
let Xsum = 0, Ysum = 0, Xmean = 0, Ymean = 0; | |
for (let i = 0; i < data.length; i++) { | |
let point = data[i]; | |
Xsum += point[xiden]; | |
Ysum += point[yiden]; | |
} |
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
function getDeliveryTime(milesTraveled, numDeliveries, gasPrice) { | |
return (slopes.milesTraveled.travelTime * milesTraveled) + (slopes.numDeliveries.travelTime * numDeliveries) + (slopes.gasPrice.travelTime * gasPrice); | |
} |
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
console.log(data[4]); | |
console.log(getDeliveryTime(data[4].milesTraveled, data[4].numDeliveries, data[4].gasPrice)); |
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
function knn(input, iterations, k, limit) { | |
let centroids = []; | |
// Step #2: Initialize k amount of clusters | |
for (let i = 0; i < k; i++) { | |
centroids.push({id: i, x: Math.random() * limit, y: Math.random() * limit}); | |
} | |
console.log(prettyjson.render(centroids, options)); | |
// loop through iterations | |
for (let i = 0; i < iterations; i++) { | |
// Find nearest centroid and assign data point to it |
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 data = [ | |
{ | |
x: 1, | |
y: 2, | |
}, | |
{ | |
x: 2, | |
y: 3, | |
}, | |
{ |
OlderNewer