Skip to content

Instantly share code, notes, and snippets.

View MarcelloDiSimone's full-sized avatar

Marcello di Simone MarcelloDiSimone

  • Synios.de
  • Hamburg Germany
View GitHub Profile
const fizzbuzz = n => `${n % 3 ? '' : 'Fizz'}${n % 5 ? '' : 'Buzz'}` || n;
arr = [...Array(100).keys()]
.map((i) => ++i)
.forEach((i) => fizzbuzz(i));
console.log(arr);
console.log(((s)=>[...s].map(c =>(n=c.charCodeAt(0),String.fromCharCode(n^(32*(n>=97&&n<=122))))).join(''))('a4raf32aso"§%&/fu4f22'));
@MarcelloDiSimone
MarcelloDiSimone / overengineered-rot13.js
Last active July 11, 2025 23:27
overengineered rot13
function rot13(message){
return [...message].map((c) => (n = c.charCodeAt(0),String.fromCharCode(n >= 65 && n <= 90?((n - 65 + 13) % 26) + 65:(n >= 97 && n <= 122 ? (n - 97 + 13) % 26 + 97 : n)))).join('');
}
console.log(rot13('§""§$§Ruby is cool!')); // "grfg"
const variance = (n) => (l = n.length, n.reduce((a, b) => a + ((b - (n.reduce((a, b) => a + b, 0) / l)) ** 2), 0) / l);