Skip to content

Instantly share code, notes, and snippets.

View dsamarin's full-sized avatar

Devin Samarin dsamarin

View GitHub Profile
@devyn
devyn / oftn-bot-sol.js
Created August 4, 2011 20:39
!sol command for oftn-bot
function Flags(text) {
var m = text.match(/^-([^ ]+)( (.+))?/);
if (m) {
var s = m[1].split("");
return {all: s, flags: s.reduce(function(o,i) { o[i] = true; return o; }, {}), args: m[2] ? m[3] : undefined};
} else {
return null;
}
}