This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;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) )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'>; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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])) |