Skip to content

Instantly share code, notes, and snippets.

View MichaelDrogalis's full-sized avatar

Michael Drogalis MichaelDrogalis

  • Confluent
  • Seattle, WA
View GitHub Profile
{ "id": 1, "name": "John" },
{ "id": 2, "name": "Bill" },
{ "id": 3, "name": "Sally" }
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
;; 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))
(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]
(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+" "mjd3089@rit.edu")
(re-matches #"[A-Z]{2}" state))
(let [result :ok] ; Or :not-ok
"Persist the user to a database here."
@MichaelDrogalis
MichaelDrogalis / capybara.rb
Created June 27, 2012 19:10 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
# =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')