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
(function(cb, ...params) { | |
const last = params.length - 1; | |
const count = params[last] - 1; | |
function iterate(c, values) { | |
params[c].forEach(function(item) { | |
if (c === count) { | |
cb(...values, item); | |
} else { | |
iterate(c + 1, [...values, item]); |
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
(function(count){ | |
if (count % 2 !== 0) { | |
throw Error('Must be even number'); | |
} | |
const result = {}; | |
const length = count / 2; | |
const sums = Array.from({length: Math.pow(9, length) / 2}); | |
const nums = Array.from({length: 10}); | |
const go = (l, m, n) => { |
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
/** | |
* Function for converting keyboard keys from cyrillic to latin | |
* @param {String} word Word on cyrillic | |
* @return {String} Word converted to latin | |
*/ | |
const convertKeyboardKeysCyrillicToLatin = word => { | |
const keyboardMap = { | |
'ф': 'a', | |
'и': 'b', | |
'c': 'c', |
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
/** | |
* Function for converting keyboard keys from latin to cyrillic | |
* @param {String} word Word on latin | |
* @return {String} Word converted to cyrillic | |
*/ | |
const convertKeyboardKeysLatinToCyrillic = word => { | |
const keyboardMap = { | |
'a': 'ф', | |
'b': 'и', | |
'c': 'c', |
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
/** | |
* Function for translitirating latin to cyrillic | |
* @param {String} word Word on latin | |
* @return {String} Word translitirated to cyrillic | |
*/ | |
const translitLatinToCyrillic = word => { | |
const translitMap = { | |
'a': 'а', | |
'b': 'б', | |
'c': 'ц', |
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
/** | |
* Function for translitirating cyrillic to latin | |
* @param {String} word Word on cyrillic | |
* @return {String} Word translitirated to latin | |
*/ | |
const translitCyrillicToLatin = word => { | |
const translitMap = { | |
'а': 'a', | |
'б': 'b', | |
'в': 'v', |
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
function sum(x) { | |
const f = y => sum(x + y); | |
f.valueOf = () => x; | |
return f; | |
} |
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
/** | |
* Function for checking array of words for anagrams | |
* @param {Array} words Array of words | |
* @return {Array} Array of arrays with anagram words | |
*/ | |
const anagram = words => words.reduce((result, word) => { | |
if (!result[word.length]) { | |
result[word.length] = [word]; | |
} | |
else { |
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
window.location.search.substr(1).split('&').map(value => { | |
return value.split('=')[1]; | |
}).filter(value => { | |
const parser = document.createElement('a'); | |
parser.href = value; | |
return parser.protocol === "javascript:"; | |
}).length; |
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/bin/env sh | |
# Install new vim | |
sudo apt-get build-dep vim | |
unzip vim-master.zip | |
cd vim-master | |
make | |
sudo make install | |
hash -r | |
vim --version |
NewerOlder