Mercurial > repo
view bin/ello @ 4433:39e6248bfb11
<kmc> echo \'as="$1"; shift; echo ".intel_syntax; $as" | gcc "$@" -c -x assembler /dev/stdin -o /tmp/as86.o && objcopy -O binary /tmp/as86.{o,bin} && xxd -p /tmp/as86.bin\' > bin/as86 && chmod +x bin/as86
author | HackBot |
---|---|
date | Mon, 10 Feb 2014 06:56:50 +0000 |
parents | d6402189a29b |
children |
line wrap: on
line source
#!/usr/bin/env node // Generated by CoffeeScript 1.6.2 (function() { var consonant_then_o, ell_manglable, ends_with_consonant, ends_with_consonant_then_vowel, name, starts_with_o; name = process.argv[2]; if (!(name != null ? name.length : void 0)) { console.log('Usage: ello <name>'); process.exit(); } consonant_then_o = /(.*)([bcdfghjklmnpqrstvwxz])([o0].*)/i; ends_with_consonant = /[bcdfghjklmnpqrstvwxz]$/i; ends_with_consonant_then_vowel = /(.*[bcdfghjklmnpqrstvwxz])[aeiouy]+$/i; starts_with_o = /[o0]/i; ell_manglable = /(.*)(el+[aeiouy]+)(.*)/i; console.log(consonant_then_o.test(name) ? name.replace(consonant_then_o, function(match, before, consonant, rest) { return before + consonant + 'ell' + rest; }) : ell_manglable.test(name) ? name.replace(ell_manglable, function(match, before, middle, rest) { return before + 'ello' + rest; }) : starts_with_o.test(name) ? 'hell' + name : ends_with_consonant_then_vowel.test(name) ? name.replace(ends_with_consonant_then_vowel, function(match, before) { return before + 'ello'; }) : ends_with_consonant.test(name) ? name + 'ello' : "Hello, " + name + "!"); }).call(this);