Last active
December 12, 2015 01:29
-
-
Save Zirak/4691768 to your computer and use it in GitHub Desktop.
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
//ths fnctn tks sntnc nd trns t t awsm | |
//md fr jvscrpt rm | |
// http://chat.stackoverflow.com/transcript/message/7491494#7491494 | |
var mk_awsm=function(sntnc){ | |
return sntnc.split(' ').map(function(wrd){ | |
return 1>=wrd.length?wrd: | |
2==wrd.length?wrd[0]: | |
/:.*(.)/.test(wrd)?wrd.replace(/:.*(.)/, '$1'): | |
wrd.split('').map(function(c,i){ | |
return 0!=i&&('a'==c||'e'==c||'o'==c||'u'==c||'i'==c||(1!=i%2&&.15>Math.random())) | |
? '' : c | |
}).join('') | |
}).join(' ') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment