Skip to content

Instantly share code, notes, and snippets.

View micnic's full-sized avatar
:octocat:
Drinking water

Nicu Micleușanu micnic

:octocat:
Drinking water
View GitHub Profile
@micnic
micnic / hny.js
Last active December 28, 2015 09:07
Happy New Year
setInterval(function () {
console.log('%cHappy New Year!', 'color: ' + '#' + Array.apply(Array, Array(3)).map(function () {
return ('0' + Math.round(Math.random() * 255).toString(16)).substr(-2);
}).join(''));
}, 1000);
@micnic
micnic / solution.js
Last active September 30, 2017 12:40
Chain Drive System
class Vector {
constructor(x, y) {
this.x = x;
this.y = y;
this.length = Math.sqrt(x * x + y * y);
}
add(vector) {
@micnic
micnic / index.html
Created February 17, 2021 14:58
Object.create() vs object literal (http://jsbench.github.io/#82ff676021f9380a2466ef0a7ba4673d) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Object.create() vs object literal</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@micnic
micnic / index.html
Last active February 18, 2021 11:33
Object.create() vs object literal #jsbench #jsperf (http://jsbench.github.io/#fe2c48dab56529fa112b30c5aaa257bb) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Object.create() vs object literal #jsbench #jsperf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>