Good day everyone! Has anyone known some code samples or articles on how to use this library? I'm having a hard time using this especially when I'm new to the syntax. Thank you! https://github.com/SparkFund/google-apps-clj
@dharrigan awesome man thanks! your code is nice to read, gonna try it soon.
Hello @adrianimanuel thanks man for the extended help, remember the last time I asked about this, and then I ended up using HTTP? turns out my senior wasn't impressed and instead wanted me to use that library since he uses this a lot. π
Yes, i've searching a lot of method as well, but this one is good. the hiccups i've met (that made me struggle for 3 wks is this part) lol... so I made the complimentary guidance with screenshot to make it easier https://clojurians.slack.com/archives/C053AK3F9/p1614308927419900
hey guys I tried to call get-auth-map and now I'm getting this
Okay guys i'm good now i just need to publish my project
so yeah I can see my token now from the webpage but whenever I paste it in the console(VSCode) I'm getting this
or when i paste the code nothing happens
I don't know any other IDE besides emacs... as in emacs i paste in stdin : PasteTheAuthCodeHere
. you should ask others who use vscode where to paste the authcode
Finally got it guys, it needs to be run in repl
I'm not familiar with that library, but a nice trick is to search on gitub or https://grep.app . Looks like there's a few examples on github: https://github.com/search?q=google-apps-clj&type=code β’ https://github.com/dharrigan/google-apis-example/blob/master/src/dharrigan/main.clj β’ https://github.com/aimanuel/Google-Oauth2-Clojure/blob/768bd86fb631ab4e1f8e92e1b8966a4b76e61057/src/newgsheet3/core.clj β’ https://github.com/SparkFund/google-apps-clj/blob/ffe53b4d07db153df0749f1c263c04a0226a185f/test/google_apps_clj/google_drive_test.clj
Hey men, thanks a lot I haven't thought of that trick:sweat_smile:
yea, it's great. you just find someone else that already wrote the code you need π
Here's a very very basic exmaple using authentication and listing the contents of your google drive. Someone else was asking about the google library a few weeks ago, so I put together an example: https://github.com/dharrigan/google-apis-example
Hi @suico.dave, i personally use this just recently (been through hard times as well to understand this around 3 wks of on & off struggle), and this is a complimentary guidance for SparkFund, to make it much more simple, no need to use Googlecreds.edn, just specify it using (def)
like @dharrigan guidance (he helped me before too).
https://github.com/aimanuel/Google-Oauth2-Clojure
@suico.dave you can personal chat me if it's still unclear π
Is there equivalent like clj-jwt lib in Clojurescript?
exactly generate with jwt/sign with :RS256
, without nodejs libs (shadow-cljs)
I saw this: https://github.com/google/closure-library/tree/master/closure/goog/crypt but I canβt find rs256
I implemented such a function for one of my projects - https://github.com/xapix-io/axel-f/blob/master/src/axel_f/buddy/jwt.cljc
@sb it is written as cljc so the code can be shared between cljs and clj and it is compatible with buddy
@delaguardo thank you very much!!
I check it!
https://github.com/xapix-io/axel-f/blob/master/test/axel_f/jwt_test.cljc there are some tests available, but they mainly for testing of my dsl. but you can get some understanding how arguments should look like π
and fill free to copy-paste or ping me in case of any questions
Ok, thanks! I try out! π
argh, the sign function is actually missing in cljs
ahh
it is not yet published (
Yes, this what I saw. Because I would like to create βAnother Clojure/script Google api lib..β and I stopped at this point.., because I need to use RS256 sign. I re-check the documentation too.. Maybe I will use nodejs at Clojurescript part to solve this.. but I donβt know that is the best idea...
btw thank you very much! π
Good afternoon fellow beginners! I'm going to be livestreaming another Clojure coding challenge in about 10-15 minutes if you'd like to join me and check it out.
Stream link is here: https://www.twitch.tv/a_fry_
This afternoon's challenge comes from the most recent Eric Normand newsletter challenge: implementing a filter indexed
function. Link to the challenge here: https://purelyfunctional.tv/issues/purelyfunctional-tv-newsletter-416-why-do-we-program-in-hard-mode/
After the challenge, I'll be live-coding my startup product for this month. If you'd like to learn more about THAT (or the Startup in a Month project in general), inquiring minds will be kindly directed here: https://startupinamonth.net/pic-story-pitch/
A silly version of the challenge with zipmap
(defn filter-index-2 [f xs]
(->> (zipmap (range (count xs)) xs)
(sort-by key)
(filter (fn [[k _]] (f k)))
(vals)))
And with reduce:
(defn filter-index [f xs]
(reduce (fn [acc i]
(let [n (nth xs i)]
(if (f i)
(conj acc n)
acc))) [] (range (count xs))))
Namespaces, I see, cannot start with a numeric, i.e., (ns 01-foo-bar)
Is that a limitation of the JVM or a restriction on Clojure itself?
its not a valid symbol > Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, ', ?, <, > and = (other characters may be allowed eventually).
so Clojure itself
Thank you.
I'll whack a char in front π
I believe java classfiles also cannot start with a number
they also can't have !
, dashes or asterisks, but those issues can be worked around with munging
this is only a restriction on symbols that the reader reads, you can create symbols with arbitrary names and create namespaces with those symbols as names as long as you don't care about mapping them to files or reading the names, or aot compilation, etc
~ % clj
Clojure 1.10.1
user=> (in-ns (symbol "hello world"))
#object[clojure.lang.Namespace 0x7b02e036 "hello world"]
hello world=> (refer 'clojure)
Syntax error compiling at (REPL:1:1).
Unable to resolve symbol: refer in this context
hello world=> (clojure.core/refer-clojure)
nil
hello world=> (+ 1 2)
3
hello world=> (def x 1)
#'hello world/x
hello world=> #'x
#'hello world/x
hello world=> (.ns #'x)
#object[clojure.lang.Namespace 0x7b02e036 "hello world"]
hello world=> *ns*
#object[clojure.lang.Namespace 0x7b02e036 "hello world"]
hello world=>
@dharrigan I totally recommend this:
(ns Γ123)
(defn hello [] 'Γ123)
(prn (hello))
Not really, j/k ;)
They do say that the hardest problem in programming is naming things, maybe we can give ourselves some new tools by using emoji
And here's what I built on the stream!
(defn filter-indexed [predicate collection]
(reduce-kv
(fn [res idx itm] (if (predicate idx itm) (conj res itm) res))
[]
collection))