Skip to content

Instantly share code, notes, and snippets.

View sordina's full-sized avatar

Lyndon Maydwell sordina

View GitHub Profile
x/y/z[_/a]
; DSL -> Zipper
(def buttonfinder (squery / form / p // input [ button ] ))
(def headerfinder (squery / header ))
(def footerfinder (squery / header ))
@sordina
sordina / foo.clj
Last active August 29, 2015 13:59
(defn raise [k] )
(defn get-symbols [coll]
(let [atm (atom [])]
(clojure.walk/postwalk
(fn [x] (if (symbol? x) (swap! atm conj x)))
coll)
@atm))
(defn raise [k] )
(defn get-symbols [coll]
(let [atm (atom [])]
(clojure.walk/postwalk
(fn [x] (if (symbol? x) (swap! atm conj x)))
coll)
@atm))
(defmacro let! [bindings & body]
(def x 10)
(def y 5)
(def z (* x y))
(defn a [b c & d] (+ z x b c
(first d)))
(a 4 5 10 598798787 876 5765 98798 57679 98797 5765)
(defn mult2 [q r]
(if (<= q 0)
0
(+ r (mult2 (- q 1) r))))
(defn err [kerr] (throw (Throwable. (str "Error: Key [" kerr "] not in ExceptionalMap."))))
; http://david-mcneil.com/post/16535755677/clojure-custom-map
(deftype ExceptionalMap [contents]
clojure.lang.IPersistentMap
(assoc [_ k v]
;; User keymap
;; -----------------------------
;; Keymaps are stored as a set of diffs that are merged together to create
;; the final set of keys. You can modify these diffs to either add or
;; subtract bindings.
;;
;; Like behaviors, keys are bound by tag. When objects with those tags are active
;; the key bindings are live. Keys can be bound to any number of Light Table commands,
;; allowing you the flexibility to execute multiple operations together. To see a list
;; of all the commands you can execute, start typing a word related to the thing you
;; Anything you type in here will be executed
;; immediately with the results shown on the
;; right.
(import 'java.lang.Math)
(def fibmatrix [[1 1] [1 0]])
(defn matrix-times [[[a1 a2] [a3 a4]] [[b1 b2] [b3 b4]]]
#!/bin/bash
read -s -p "Enter Password: " foo
echo
echo $foo | md5 | tr -d '\n' | pbcopy
(defmacro single-call [[x y & z]]
`(~x ~y ~@z))
(defmacro multi-call [ & xs]
`(do ~@(for [x xs] `(single-call ~x))))
(prn (macroexpand-1 `(single-call (+ 1 2 3 4))))
(prn (macroexpand-1 `(multi-call (+ 1 2 3 4) (+ 4 5 6 7))))
<!DOCTYPE HTML>
<html>
<head>
<title>movement</title>
<style type="text/css" media="all">
body {
position: absolute;
width: 100%;
height: 100%;
margin: 0;