Merged with master

This commit is contained in:
Sameer Rahmani 2019-01-14 18:53:41 +00:00
parent 8241ef3cd8
commit 79b6ffeca1
6 changed files with 66 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{:source-paths ["src"]
:dependencies [[cljs-http "0.1.45"]]
:dependencies [[org.clojure/clojurescript "1.10.439"]
[cljs-http "0.1.45"]]
:nrepl {:port 8282}
:builds

View File

@ -19,7 +19,7 @@
(when token
(.setCredentials oauth token))
oauth)))
p
(defn upload-file
[oauth])

View File

@ -0,0 +1,54 @@
(ns john-titor.github.core
(:require-macros [cljs.core.async.macros :refer [go]])
(:require
;; TODO: Remove xhr2 after finishing the lib
["xhr2" :as xhr2]
[cljs-http.client :as http]
[cljs.core.async :refer [<!]]))
(set! js/XMLHttpRequest xhr2)
(def github-username "lxsameer")
(def token "4e61196d7c72ff19b7aa1a6f6c968654f1d06d44")
(def base-url "https://api.github.com")
(defn default-opts
[token]
{:headers
{"Accept" "application/vnd.github.v3+json"
"Authorization" (str "token " token)
"User-Agent" github-username}})
(defn process-response
[f ch]
(go (f (<! ch))))
(defn- api-call
[f url opts]
(let [options (merge (default-opts token) opts)]
(f (str base-url url) options)))
(defn api-get
([url]
(api-get url {}))
([url opts]
(api-call http/get url options)))
(defn api-post
[url opts]
(api-call http/post url options))
(defn notifications
([]
(notifications {}))
([opts]
(api-get "/notifications" {})))
(process-response (fn [res]
(println (doseq [x (:body res)]
(println (str (:name (:repository x))
" "
;;(:title (:subject x))
" "
(:reason x))))))
(notifications))

View File

@ -8,7 +8,11 @@ try {require('source-map-support').install();} catch (e) {console.warn('no "sour
global.CLOSURE_NO_DEPS = true;
<<<<<<< Updated upstream
global.CLOSURE_DEFINES = {"shadow.cljs.devtools.client.env.repl_pprint":false,"shadow.cljs.devtools.client.env.devtools_url":"","shadow.cljs.devtools.client.env.autoload":false,"shadow.cljs.devtools.client.env.proc_id":"e01e0e97-fd19-4247-a69e-568995e2aeb7","goog.ENABLE_DEBUG_LOADER":false,"shadow.cljs.devtools.client.env.server_port":9630,"shadow.cljs.devtools.client.env.use_document_host":true,"shadow.cljs.devtools.client.env.module_format":"goog","goog.LOCALE":"en","shadow.cljs.devtools.client.env.build_id":"app","shadow.cljs.devtools.client.env.ignore_warnings":false,"goog.DEBUG":true,"cljs.core._STAR_target_STAR_":"nodejs","shadow.cljs.devtools.client.env.ssl":false,"shadow.cljs.devtools.client.env.enabled":true,"shadow.cljs.devtools.client.env.server_host":"localhost","goog.TRANSPILE":"never"};
=======
global.CLOSURE_DEFINES = {"shadow.cljs.devtools.client.env.repl_pprint":false,"shadow.cljs.devtools.client.env.devtools_url":"","shadow.cljs.devtools.client.env.autoload":false,"shadow.cljs.devtools.client.env.proc_id":"06073e1c-1014-4dc0-a8ca-c2d800ea57c5","goog.ENABLE_DEBUG_LOADER":false,"shadow.cljs.devtools.client.env.server_port":9630,"shadow.cljs.devtools.client.env.use_document_host":true,"shadow.cljs.devtools.client.env.module_format":"goog","goog.LOCALE":"en","shadow.cljs.devtools.client.env.build_id":"app","shadow.cljs.devtools.client.env.ignore_warnings":false,"goog.DEBUG":true,"cljs.core._STAR_target_STAR_":"nodejs","shadow.cljs.devtools.client.env.ssl":false,"shadow.cljs.devtools.client.env.enabled":true,"shadow.cljs.devtools.client.env.server_host":"localhost","goog.TRANSPILE":"never"};
>>>>>>> Stashed changes
var goog = global.goog = {};

View File

@ -30,11 +30,12 @@ Return a list of credential pairs."
ARGS should be ignored."
(interactive "P\nsHost: ")
(dolist (pair (auth/find-credential host))
(message (concat "User: " (utils/bold (car pair))
" Passowrd: " (utils/bold(car (cdr pair)))))))
(let* ((user (car pair))
(pass (car (cdr pair)))
(msg (concat "User: " (utils/bold user)
" Passowrd: " (utils/bold pass))))
(message msg))))
(auth/credential-for nil "freenode")
(auth/find-credential "freenode")
(defun extensions/irc-initialize ()
"Initialize the Auth extension."

0
lib/extensions/github.el Normal file
View File