Skip to content

Instantly share code, notes, and snippets.

View lildata's full-sized avatar

Programming is fun lildata

View GitHub Profile
  • FOR XML RAW not mich just <rows
  • FOR XML AUTO it seems some kind of auto nesting based on the first column
  • FOR XML EXPLICIT control but kind of creepy and verbose
  • FOR XML PATH :-D
@lildata
lildata / 0-simple-clojure-web.md
Last active February 2, 2016 19:26
When you want to create a webpage with clojure but you're too lazy to use hiccup and garden

When you want to create a webpage with clojure but you're too lazy to use hiccup and garden

@lildata
lildata / gist:c318a44b18d7d6de24a9
Created January 31, 2016 16:10 — forked from bayan/gist:3382884
Clojure DSL to generate static HTML
;; 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")
@lildata
lildata / gist:fd8ebfbd8d51932d5684
Created February 16, 2016 21:42 — forked from gorsuch/gist:1418850
clojure uuid
(defn uuid [] (str (java.util.UUID/randomUUID)))
@lildata
lildata / some-beat.clj
Last active March 25, 2016 10:49
overtone 🎹 🎧
(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 [])))
@lildata
lildata / maps2vecs.clj
Last active January 12, 2017 19:43
▤ tables & ℳ matrix
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]]
@lildata
lildata / webview-for-martin.clj
Created December 29, 2016 22:24 — forked from jackrusher/webview-for-martin.clj
An example boot-ified Swing app that contains a JavaFX WebView (Webkit instance).
#!/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))
@lildata
lildata / README.md
Created June 2, 2017 10:20 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


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


As seen on https://brendanzagaeski.appspot.com/0004.html
%PDF-1.1
%¥±ë
1 0 obj
<< /Type /Catalog
/Pages 2 0 R
@lildata
lildata / clipboard.clj
Created September 22, 2017 19:45 — forked from exupero/clipboard.clj
Clojure code to interact with the system clipboard
(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)))