Skip to content

Instantly share code, notes, and snippets.

View ITSecMedia's full-sized avatar
🃏
If anything is worth doing, do it with all your heart. --Buddha

Norman Eckstein ITSecMedia

🃏
If anything is worth doing, do it with all your heart. --Buddha
View GitHub Profile
@ITSecMedia
ITSecMedia / 00_destructuring.md
Created March 31, 2020 21:01 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@ITSecMedia
ITSecMedia / all-lein-templates.txt
Created July 25, 2020 15:57 — forked from anonymous/all-lein-templates.txt
for i in {1..28} ; do lein search lein-template $i ; done | grep '^\[' | perl -pe 's,^\[,,; s,/.*?],:,' | sort | uniq -c | tee all-lein-templates.txt
1 acorn: A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om.
8 amp: Leiningen template for AMP (Alfresco Module Package) projects.
1 angular-cl2: A Leiningen template for using AngularJS and ChlorineJS
1 angular: Clojure and AngularJS in perfect harmony.
6 angular: Clojure and AngularJS in perfect harmony. $ lein new angular <name>
2 angularjs-app: Leiningen template for web application with http-kit and angularjs
5 angular-simple: Clojure and AngularJS $ lein new angular-simple <name>
1 aperiodic-cljs: My cljs development starting point. Basically ripped from lein-cljsbuild.
1 apijr: clojurescript project template
1 appfgo: 'lein new' template for Funcgo application
87 luminus: a template for creating Luminus applications
7 mala: A Leiningen template for Mala
1 maple: A leinginen template with MPL
3 mesos-framework: A template for setting up mesos-frameworks using component.
3 mies-brepl: A minimal ClojureScript project template with REPL
7 mies-node: A minimal ClojureScript Node.js project template
27 mies-om: A minimal Om project template
2 mies-weasel: A minimal ClojureScript project template with Weasel REPL, forked from mies.
40 mies: A minimal ClojureScript project template
3 mies: FIXME: write description
;;
;; Take a textfile which contains a copy of the raw html of a humblebundle user account download
;; select the download page html table with the mouse copy+paste in a textfile
;; Use this file to create a list of folders based on the download names.
;;
;; === TEXT FILE CONTENT EXAMPLE ===
;; Book of Making – Volume 1
;; Raspberry Pi Press
;; PDF
;; 49 MB md5
@ITSecMedia
ITSecMedia / promises-cljs.md
Created October 7, 2021 20:38 — forked from pesterhazy/promises-cljs.md
Promises in ClojureScript

Chaining promises

Chaining promises in ClojureScript is best done using the thread-first macro, ->. Here's an example of using the fetch API:

(-> (js/fetch "/data")
    (.then (fn [r]
             (when-not (.-ok r)
               (throw (js/Error. "Could not fetch /data")))
             (.json r)))