Skip to content

Instantly share code, notes, and snippets.

View Raynes's full-sized avatar

Anthony Grimes Raynes

View GitHub Profile
(defn- parse-prefix [{:keys [raw]}]
(when-let [[modes prefixes] (rest (re-find #"PREFIX=\((.*?)\)(\S+)" raw))]
(zipmap prefixes modes)))
irclj.core> (parser/parse ":asimov.freenode.net 005 shameful CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQcgimnpstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=freenode KNOCK STATUSMSG=@+ CALLERID=g :are supported by this server")
{:command "005", :params ["shameful" "CHANTYPES=#" "EXCEPTS" "INVEX" "CHANMODES=eIbq,k,flj,CFLMPQcgimnpstz" "CHANLIMIT=#" "120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=freenode KNOCK STATUSMSG=@+ CALLERID=g :are supported by this server"], :raw ":asimov.freenode.net 005 shameful CHANTYPES=# EXCEPTS INVEX CHANMODES=eIbq,k,flj,CFLMPQcgimnpstz CHANLIMIT=#:120 PREFIX=(ov)@+ MAXLIST=bqeI:100 MODES=4 NETWORK=freenode KNOCK STATUSMSG=@+ CALLERID=g :are supported by this server", :nick "asimov.freenode.net"}
irclj.core> (parse-prefix *1)
{\v \+, \o \@}
(defn get-var-docstring [nspace-sym sym]
(try
(-> `(var ~(symbol (str nspace-sym) (str sym))) eval meta :doc)
;; HACK: to handle types
(catch Exception _)))
(defn read-pass []
(print "Password: ")
(flush)
(join (.readPassword (System/console))))
irclj.parser> (pprint (parse-message ":[email protected] PRIVMSG #4clojure :ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client"))
{:command "PRIVMSG",
:params
["#4clojure"
"ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client"],
:raw
":[email protected] PRIVMSG #4clojure :ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client",
:host "li231-96.members.linode.com",
:user "~amalloy",
:nick "amalloy"}
irclj.parser> (parse-message ":[email protected] PRIVMSG #4clojure :ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client")
{:command "PRIVMSG", :params ["#4clojure" "ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client"], :raw ":[email protected] PRIVMSG #4clojure :ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client", :host "li231-96.members.linode.com", :user "~amalloy", :nick "amalloy"}
irclj.parser> (pprint (parse-message ":[email protected] PRIVMSG #4clojure :ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client"))
{:command "PRIVMSG",
:params
["#4clojure"
"ckirkendall: would you mind using amalloy on irc, rather than alan? it's nice to get notifications from my irc client"],
:host "li231-96.members.linode.com",
:user "~amalloy",
:nick ":amalloy"}
nil
irclj.parser> (pprint (parse-message ":[email protected] PRIVMSG #clojure :amalloy: poes law has just bitten me. i cant tell if you are joking"))
{:command "PRIVMSG",
:params
["#clojure"
"amalloy: poes law has just bitten me. i cant tell if you are joking"],
:host "203.79.117.117",
:user "~andrew",
:nick ":brehaut"}
nil
tentacles.users> (map :login (followers 'amalloy))
("MayDaniel" "Raynes" "tonyl" "jColeChanged" "hoggarth" "ossareh" "stonegao" "ohpauleez" "raek" "segfaulthunter" "invaliduser" "gigasquid" "Clinteger" "odekopoon" "devn" "dbyrne" "imissmyjuno" "k4rtk" "xmlblog" "jeremyheiler" "amcnamara" "sconover" "srid" "mbacarella" "carlwarnick" "spoon16" "octopusgrabbus" "daviddavis")
tentacles.users> (count *1)
28
tentacles.users> (edit {:auth "Raynes:REDACTED" :bio "My name is Anthony Grimes. I live in a small town called Eldridge in Alabama. I am a programmer and a very avid supporter of functional programming and Clojure. I am currently writing a book on Clojure called [Meet Clojure](http://meetclj.raynes.me). I'm the author (or co-author) of a number of Clojure projects including [Try Clojure](http://tryclj.com) and [clojail](https://github.com/flatland/clojail), having spoken about the latter at Clojure Conj 2011. I am currently employed by [Geni](http://geni.com) as a paid intern working with Clojure on the backend."})
{:disk_usage 50452, :collaborators 0, :plan {:private_repos 0, :space 307200, :collaborators 0, :name "free"}, :followers 74, :following 36, :gravatar_id "54222b6321f0504e0a312c24e97adfc1", :name "Anthony Grimes", :avatar_url "https://secure.gravatar.com/avatar/54222b6321f0504e0a312c24e97adfc1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png", :bio "My name is A