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 spec-test | |
(:require [clojure.string :refer [lower-case blank?]] | |
[clojure.spec :as s] | |
[buddy.hashers :as hsh] | |
[compojure.core :refer [defroutes POST]] | |
[korma.core :as dbc] | |
[taoensso.timbre :as log] | |
[postgre.models :refer [users]])) | |
;;; Utils |
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
(use '(incanter core stats charts)) | |
;; unfortunately, this solution does not focus chart window (at least, on MacOSX) | |
;; it means, that you should use mouse to close a window | |
(defn view-on-top [obj & opts] | |
(doto (apply view obj opts) | |
(.setAlwaysOnTop true) | |
(.requestFocus) | |
(.setAlwaysOnTop false))) |
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
(require 'cider) | |
(setq incanter-temp-chart-file "/tmp/chart.png") | |
(setq incanter-wait-time 500) | |
(defun incanter-display-image-inline (buffer-name file-name) | |
"Use `BUFFER-NAME' to display the image in `FILE-NAME'. | |
Checks weather `BUFFER-NAME' already exists, and if not create | |
as needed." | |
(switch-to-buffer-other-window buffer-name) |
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
;;; make & evaluate 4000 maps: {0 0}, {0 0, 1 1}, {0 0, 1 1, 2 2}, etc. | |
(def maps (doall | |
(map (fn [n] | |
(let [rng (range (inc n))] | |
(zipmap rng rng))) | |
(range 4000)))) | |
(defn mfilter-old [f input] | |
(when input | |
(->> input ; uses macro |
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
class AttMed { | |
private int attention = 0; | |
private int meditation = 0; | |
AttMed() {} | |
public []int toArray() { | |
return {this.attention, this.meditation}; | |
} | |
} |
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
package main | |
import ( | |
"fmt" | |
"github.com/iron-io/iron_go/config" | |
"github.com/iron-io/iron_go/mq" | |
) | |
func main() { | |
conf := config.Presets["mq"] |