This file contains hidden or 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 range = (stop, start = 0, step = 1) => ( | |
(step === 0 || ((stop - start) * Math.sign(step)) <= 0) ? | |
[] : | |
[...new Array(Math.abs(Math.ceil((stop - start) / step)))].map((_, index) => index * step + start) | |
) | |
range(6) | |
// output : [0, 1, 2, 3, 4, 5] | |
range(20, 1, 5) |
This file contains hidden or 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
// ==UserScript== | |
// @name IMDB Orjinal title | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author cevherkarakoc | |
// @include http://www.imdb.com/title/tt* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or 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 cartesianToPolar(x,y){ | |
return { | |
radius: Math.sqrt( Math.pow(x, 2) + Math.pow(y, 2) ), | |
alpha: Math.atan2(y, x) | |
} | |
} |
This file contains hidden or 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 polarToCartesian(radius,radian){ | |
return { | |
x:radius*Math.cos(radian), | |
y:radius*Math.sin(radian) | |
} | |
} |