Utilities

I love the web, we can do anything. But well... sometime it feels like we have to do EVERYTHING.
These are pieces of code you will find useful for any web app.
These are all the tiny pieces of code you will write again and again for a real app. Just copy and paste.



Often you want to display text and add an ellpsis at end. This does just that, and counts correctly the number of characters.
  • this is a very long…
  • this is a v and more
  • this is a very lo...


When you display a list of things to the user, this piece of code adds nice looking separators.
  • "Aaron, Bob, Charlie, Danny, Elen, Francis and Gary"
  • "Aaron, Bob, Charlie, Danny, Elen, Francis and Gary"
  • "Aaron, Bob, Charlie and more"


Another text manipulation, when you want to show at least x items, and more when needed.
  • [ "Aaron", "Bob", "Charlie", "And more" ]
  • [ "Aaron", "Bob", "Charlie", "Danny", "Elen", "And someone" ]
  • "Aaron, Bob, Charlie and more"