Skip to content

Instantly share code, notes, and snippets.

View myfit's full-sized avatar

MyFit, Inc myfit

View GitHub Profile
(use '(com.mongodb ObjectId))
(prn (. (ObjectId.) toString)))
"4c0800a583009bdc2bd8d166"
----
(defmethod print-dup com.mongodb.ObjectId [o w]
(.write w (format "#^com.mongodb.ObjectId (com.mongodb.ObjectId. \"%s\")" (. o toString))))
(defn friends-are-friends [uids1 uid2]
(call-method "facebook.friends.areFriends"
{:uids1 uids1 :uids2 uids2}))
(defn call-method [method params]
...POST request...)
(defn apify-method [call-sym]
(let [call (name call-sym)
call-sp (.split call "-")
class (first call-sp)
method1 (first (rest call-sp))
method (if (< 1 (count call-sp))
(rest (rest call-sp)) ())]
(defn get-name [fb-uid]
(with-facebook (make-facebook-connection "myapikey" "mysecret")
(fql-query (str "SELECT name FROM users WHERE uid=" fb-uid))))