- dynamic
- funcional
- el código son datos (homoiconic)
- syntactic abstractions
- functions
- macros (no reader macros)
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
(ns recur.mult-recur-example) | |
(defn mul-recur [a b] | |
(+ a (mul-recur a (dec b)))) | |
(defn mul-recur2 [a b] | |
(+ a (mul-recur a (dec b)))) | |
(defn mul-recur-tail [a b] | |
(loop [acc 0N left b] |
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
(ns clj-bcn.intro1) | |
(comment | |
;;; literals ;;; | |
"string" | |
\s | |
1 | |
3/4 | |
123412342134214312342134N |
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
(set-env! | |
:source-paths #{"src"} | |
:dependencies '[[org.clojure/clojure "1.7.0"] | |
[adzerk/boot-test "1.0.4" :scope "test"]] | |
) | |
(require '[adzerk.boot-test :refer :all]) | |
(deftask testing | |
"Profile setup for running tests." |
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
;; indexOf depends on hosted language (java/javascript) | |
;; recurrent solution , returns -1 on not-found | |
(defn index-of [coll value] | |
(loop [idx 0 items coll] | |
(cond | |
(empty? items) -1 | |
(= value (first items)) idx | |
:else (recur (inc idx) (rest items))))) |
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
https://gitlab.com/at-home-modifier/at-home-modifier-evdev | |
Map space (65:37) and capslock (66:37) to control for combination with other keys. | |
Depending on the keyboard sometimes space works as a control if typing space and key at same time. | |
It almost never happens to me with a mechanical keyboard or the old thinkpad keyboard. | |
## for ubuntu | |
sudo add-apt-repository ppa:yurivkhan/ahm | |
sudo apt-get update |
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 scip-ex13 | |
"Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers." | |
[& args] | |
(apply + (->> args (sort) (reverse) (take 2) (map #(* % %))))) |
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
;; listen to event in javascript dom | |
;; https://swannodette.github.io/2013/11/07/clojurescript-101/ | |
(defn listen [el type] | |
(let [out (chan)] | |
(events/listen el type | |
(fn [e] (put! out e))) | |
out)) | |
(def clicks (listen (dom/getElement "search1") "click")) |
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
! output taken from: | |
! xmodmap -pke | egrep '(Control|Super|Alt|Menu)' | |
! Use to set keycodes correctly below. List reordered to match | |
! keys from left to right. | |
! run xmodmap .Xmodmap to test changes. | |
! keycode 66 = CapsLock | |
! keycode 37 = Control_L NoSymbol Control_L | |
! keycode 133 = Super_L NoSymbol Super_L | |
! keycode 64 = Alt_L Meta_L Alt_L Meta_L |
I hereby claim:
- I am fgui on github.
- I am fgui (https://keybase.io/fgui) on keybase.
- I have a public key whose fingerprint is 62FC 71C1 B76E 98C6 8F29 9214 2667 3348 5C03 FAC0
To claim this, I am signing this object: