THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
// Fisher-Yates shuffle algorithm | |
function shuffle(arr) { | |
const result = [...arr]; | |
for (let i = result.length - 1; i >= 0; i -= 1) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[result[i], result[j]] = [result[j], result[i]]; | |
} | |
return result; | |
} |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.