Skip to content

Instantly share code, notes, and snippets.

@Zirak
Last active December 12, 2015 01:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Zirak/4691768 to your computer and use it in GitHub Desktop.
Save Zirak/4691768 to your computer and use it in GitHub Desktop.
//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