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
{ "id": 1, "name": "John" }, | |
{ "id": 2, "name": "Bill" }, | |
{ "id": 3, "name": "Sally" } |
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
Host onyx-kafka | |
HostName github.com | |
User git | |
IdentityFile /home/ubuntu/.ssh/id_onyx-kafka | |
IdentitiesOnly yes | |
Host onyx-kafka-0.8 | |
HostName github.com | |
User git | |
IdentityFile /home/ubuntu/.ssh/id_onyx-kafka-0.8 | |
IdentitiesOnly yes |
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
;; Datomic example code | |
;; demonstrates various update scenarios, using a news database | |
;; that contains stories, users, and upvotes | |
;; grab an in memory database | |
(use '[datomic.api :only (q db) :as d]) | |
(def uri "datomic:mem://foo") | |
(d/create-database uri) | |
(def conn (d/connect uri)) |
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 clotp.core | |
(:require [clojure.core.match :refer [match]])) | |
(def next-process-id (atom 0)) | |
(def processes (atom {})) | |
(defn next-pid [] | |
(swap! next-process-id inc)) | |
(defn spawn [f & args] |
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 dire-examples.bad-core | |
(:require [dire.core :refer [with-precondition! with-postcondition!]])) | |
(defn save-user [& {:keys [username email password state]}] | |
(if (and (and (> (count username) 4) (< (count username) 11)) | |
(and (> (count password) 6) (re-matches #".*\d.*" password)) | |
(re-matches #"\w+@\w+\.\w+" "[email protected]") | |
(re-matches #"[A-Z]{2}" state)) | |
(let [result :ok] ; Or :not-ok | |
"Persist the user to a database here." |
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
# =Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
# =Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |