Skip to content

Instantly share code, notes, and snippets.

View miked1ck's full-sized avatar
🏠
WFH

Mike Dick miked1ck

🏠
WFH
View GitHub Profile
const indicatorClasses = classNames({
'indicator--warn': this.state.body.length > 120 && body.length <= 140,
'indicator--error': this.state.body.length > 140,
});
return (<span className={indicatorClasses}>{140 - this.state.body.length}</span>);
@miked1ck
miked1ck / hashtag.js
Created May 15, 2014 02:42
Convert a string to a usable hashtag
// string to convert to hashtag
var string = "This is a Long Title to Convert to a Hashtag";
// common words we want to filter out that make for a bad hashtag
// source: http://en.wikipedia.org/wiki/Most_common_words_in_English
var common = [
'to','of','in','for','on','with','at','by','from','up','about','into','beneath','the',
'and','a','that','I','it','not','he','as','you','this','but','his','they','her','she','or',
'an','will','my','one','all','would','there','their','vs'
];