Skip to content

Instantly share code, notes, and snippets.

@javazquez
javazquez / gapi.cljs
Last active Dec 3, 2017
Clojurescript Gmail API example ran with lumo. Converted Nodejs example from https://developers.google.com/gmail/api/quickstart/nodejs
View gapi.cljs
;; Juan Vazquez
;; javazquez.com
;; https://github.com/javazquez
;; example converted from https://developers.google.com/gmail/api/quickstart/nodejs
(ns gmail-client.gapi
(:require [fs ]
[readline]
[googleapis :as google]
[google-auth-library :as googleAuth]
[goog.object]))
@javazquez
javazquez / clojure_instaparse_arnoldc_grammer.clj
Created Feb 18, 2017
clojure instaparse arnoldc grammer
View clojure_instaparse_arnoldc_grammer.clj
Program = method-declaration* begin-main wspace method-declaration*;
begin-main = <'IT\'S SHOWTIME'> (statement wspace)* end-main ;<wspace> = <#'\s*'>;statement = wspace (assignment | printing | decvar | assign-var-from-method-call |
call-method | if | while | call-method | return);method-statement = (assignment | printing | decvar | assign-var-from-method-call |
call-method | if | while | call-method);call-method = <'DO IT NOW'> wspace method-name numvar* wspace;method-name = (number| #'[a-zA-Z][a-zA-Z0-9]*' |zero |false | true) assign-var-from-method-call = <'GET YOUR ASS TO MARS'> wspace variable wspace call-method;assignment = <'GET TO THE CHOPPER'> numvar wspace set-val wspace end-assignment wspace;
while= <'STICK AROUND'> numvar wspace statement* end-while ;
<end-while>= <'CHILL'>;
set-val= <'HERE IS MY INVITATION'> numvar (arithmetic-op|logical-op)*;
<end-assignment>= <'ENOUGH TALK'>;
@javazquez
javazquez / basicAuthEx.groovy
Created May 16, 2015
Basic Auth with Groovy
View basicAuthEx.groovy
//Here is a quick groovy 1.7.4 Basic Auth Example
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0' )
def authSite = new groovyx.net.http.HTTPBuilder( 'http://10.110.201.115/~juanvazquez/basicAuth/' )
authSite.auth.basic 'test', 'this'
println authSite.get( path:'testAuth.html' )
@javazquez
javazquez / soundex.clj
Last active Mar 19, 2018
Clojure Soundex
View soundex.clj
;;Example of Clojure Soundex Code for my blog
;;http://javazquez.com/juan/2012/08/28/clojure-soundex/
(def val-map {"FBVP" 1,"CGJKQSXZ" 2,"DT" 3,"L" 4,"MN" 5,"R" 6, "AEIOU" "!" }))
(defn map-builder [alphas num]
(zipmap alphas (repeat num)))
(def conversion-map
(reduce merge (map #(map-builder (key %) (val % )) val-map) ))
You can’t perform that action at this time.