FOR XML RAWnot mich just<rowsFOR XML AUTOit seems some kind of auto nesting based on the first columnFOR XML EXPLICITcontrol but kind of creepy and verboseFOR XML PATH:-D
When you want to create a webpage with clojure but you're too lazy to use hiccup and garden
This file contains hidden or 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
| ;; Generating static HTML using Clojure macros | |
| ;; It is possible to write a DSL in Clojure that generates HTML markup without the need to write a separate parser and compiler (e.g. HAML). | |
| ;; Our aim here would be to write code that converts the following Clojure code into the HTML below it | |
| ;; (html | |
| ;; (head) | |
| ;; (body | |
| ;; (h1 "An example") |
This file contains hidden or 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
| (defn uuid [] (str (java.util.UUID/randomUUID))) |
This file contains hidden or 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
| (def nome (metronome 500)) | |
| (defn some-beat [nome] | |
| (let [beat (nome)] | |
| ; kick drum pattern | |
| (at (nome beat) (kick)) | |
| (at (nome (+ 5 beat)) (kick)) | |
| (at (nome (+ 7 beat)) (kick)) | |
| (apply-at (nome (+ 8 beat)) some-beat nome []))) |
This file contains hidden or 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
| user=> (def m1 [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6} {:a 7 :c 9 :b 8 :d 10}]) | |
| #'user/m1 | |
| user=> (vec (for [m m1] ((juxt :a :b :c) m))) | |
| [[1 2 3] [4 5 6] [7 8 9]] |
This file contains hidden or 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
| #!/usr/bin/env boot | |
| ;; -*- mode: Clojure;-*- | |
| (set-env! :dependencies '[[seesaw "1.4.5"]]) | |
| (use 'seesaw.core) | |
| (import '(javafx.scene.web WebView) | |
| '(javafx.scene SceneBuilder) | |
| '(javafx.scene.layout VBoxBuilder)) |
A curated list of AWS resources to prepare for the AWS Certifications
A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.
For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed
This file contains hidden or 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
| As seen on https://brendanzagaeski.appspot.com/0004.html | |
| %PDF-1.1 | |
| %¥±ë | |
| 1 0 obj | |
| << /Type /Catalog | |
| /Pages 2 0 R |
This file contains hidden or 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
| (refer-clojure :exclude '[slurp spit]) | |
| (import '[java.awt.datatransfer DataFlavor StringSelection Transferable]) | |
| (defn clipboard [] | |
| (.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))) | |
| (defn slurp [] | |
| (try | |
| (.getTransferData (.getContents (clipboard) nil) (DataFlavor/stringFlavor)) | |
| (catch java.lang.NullPointerException e nil))) |
