Skip to content

Instantly share code, notes, and snippets.

View AlexVvx's full-sized avatar

Alexander Vinober AlexVvx

View GitHub Profile
@AlexVvx
AlexVvx / open-day-solutions.js
Last active May 24, 2017 15:16
open-day-solutions
var getChange = (cost, sum) => {
let rem = Math.round((sum - cost) * 100);
return [100, 50, 20, 10, 5, 1].map(v => {
let n = ~~(rem / v);
rem -= n * v;
return n;
}).reverse();
}
var zoom = (n, f=v=>Math.min(v,n-v-1)) =>
<!DOCTYPE html>
<html ng-app="test">
<head>
<title>Performance Comparison for Knockout, Angular and React</title>
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.css" rel="stylesheet" />
<style type="text/css">
* { box-sizing:border-box; }
body { padding:30px 0; }
h2 { margin:0; margin-bottom:25px; }