Skip to content

Instantly share code, notes, and snippets.

@berkes
Created October 29, 2012 10:02
Show Gist options
  • Select an option

  • Save berkes/3972710 to your computer and use it in GitHub Desktop.

Select an option

Save berkes/3972710 to your computer and use it in GitHub Desktop.
String.tenderloverized
class String
# http://confreaks.com/videos/1228-aloharuby2012-keynote-rails-4-and-the-future-of-web
def t13d
if length > 2
return "#{self[0,1]}#{(length - 2)}#{self[-1,1]}"
else
return self
end
end
end
"tenderloverized".t13d #=> t13d
"parrallellizzattion".t13d #=> "p17n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment