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 some(lista, warunek){ | |
| return !!lista.length && (warunek(lista[0]) || some(lista.slice(1), warunek)); | |
| } | |
| function every(lista, warunek){ | |
| return !lista.length || warunek(lista[0]) && every(lista.slice(1), warunek); | |
| } |
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
| var stringi = 'jfoof ojo jo jojf ojfos s ofjso jfos joj ojfo jo jo fjo j'; | |
| var tablicaStringow = stringi.split(' '); | |
| var najdluzszeStringi; | |
| var dlugoscNajdluzszegoStringa = 0; | |
| for(var i=0; i<tablicaStringow.length; i++){ | |
| if(tablicaStringow[i].length > dlugoscNajdluzszegoStringa){ | |
| najdluzszeStringi = [tablicaStringow[i]]; | |
| dlugoscNajdluzszegoStringa = najdluzszeStringi[0].length; |
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 SubsetSum(z,k){k=k||[0];l=k.length;while(l&&k){s=z[0]+k[l-1];k.push(s);k=s&&k;l--;}return!!z[0]&&(!k||SubsetSum(z.slice(1),k));} |
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
| max [] = error "cannot get max from empty list" | |
| max [x] = x | |
| max (head:tail) | |
| | head > max tail = head | |
| | otherwise = max tail |
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
| // wciaga | |
| { | |
| "gruboscSciany": 25, | |
| "sciany": [ | |
| {"start": {"x": 10, "y":20}, "end":{"x": 200, "y": 100}}, | |
| {"start": {"x": 10, "y":20}, "end":{"x": 200, "y": 100}}, | |
| {"start": {"x": 10, "y":20}, "end":{"x": 200, "y": 100}}, | |
| {"start": {"x": 10, "y":20}, "end":{"x": 200, "y": 100}}, | |
| {"start": {"x": 10, "y":20}, "end":{"x": 200, "y": 100}}, |
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
| #!/bin/bash | |
| docker run --net=host -v `pwd`:`pwd` -w `pwd` -ti --rm node npm "$@" |
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 () { | |
| function loadScript(url) { | |
| return new Promise((resolve) => { | |
| let script = document.createElement('script'); | |
| script.type = 'text/javascript'; | |
| script.async = false; | |
| script.src = url; |
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 reduce(func, acc, items){ | |
| for(var i = 0; i<items.length; i++){ | |
| acc = func(acc, items[i]); | |
| } | |
| return acc; | |
| } |
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
| let reduce = function(func, acc, items){ | |
| if(items.length === 0){ | |
| return acc; | |
| } | |
| return reduce(func, func(acc, R.head(items)) , R.tail(items)); | |
| } |