Skip to content

Instantly share code, notes, and snippets.

@cuuupid
Created November 9, 2018 17:05
Show Gist options
  • Save cuuupid/6b7a7aee6da292bff56a80294423ebdb to your computer and use it in GitHub Desktop.
Save cuuupid/6b7a7aee6da292bff56a80294423ebdb to your computer and use it in GitHub Desktop.
automatically linkedinify any text.
var linkedinify = bropost =>
bropost.split(/ |\n/g)
.map((post, i) => i % 5 == 0 ? post.toUpperCase() : post.toLowerCase())
.join(' ').split(/(?=\.|!|\?)/g).join('\n\n')
+ '\n\n' + bropost.split(/ |\n/g).map(word => '#' + word).join(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment