$ erlc -S test.erl
This file contains 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 example.errors) | |
(defn clean-address [params] | |
"Ensure (params :address) is present" | |
(if (empty? (params :address)) | |
[nil "Please enter your address"] | |
[params nil])) | |
(defn clean-email [params] | |
"Ensure (params :email) matches *@*.*" |
This file contains 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
#!/bin/bash | |
# * * * * * root /path/to/riak_graphite_stats.sh | |
set -e | |
SOURCE=$(hostname) | |
GRAPHITE_PORT=2003 | |
GRAPHITE_SERVER="server" | |
PREFIX="riak_stats" | |
STATUS=$(/usr/sbin/riak-admin status) |
This file contains 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 '[clojure.string :as str] '[clojure.java.shell :as shell] '[taoensso.timbre :as timbre]) | |
(defn with-free-port! | |
"Attempts to kill any current port-binding process, then repeatedly executes | |
nullary `bind-port!-fn` (which must return logical true on successful | |
binding). Returns the function's result when successful, else throws an | |
exception. *nix only. | |
This idea courtesy of Feng Shen, Ref. http://goo.gl/kEolu." | |
[port bind-port!-fn & {:keys [max-attempts sleep-ms] |
This file contains 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 storm.starter.clj.word-count-kafka | |
(:import ;[backtype.storm StormSubmitter LocalCluster] | |
[storm.kafka KafkaConfig HostPort KafkaSpout SpoutConfig StringScheme]) | |
(:use [backtype.storm clojure config]) | |
(:gen-class)) | |
(def ^{:private true} | |
host (list "localhost:9092")) | |
(def ^{:private true |
This file contains 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 '[datomic.api :only [q db] :as d]) | |
(def uri "datomic:mem://accounts") | |
;; create database | |
(d/create-database uri) | |
;; connect to database | |
(def conn (d/connect uri)) |
- Distributed Systems Concepts and Design (5th Edition) (http://skec.ac.in/ebooks/George-Coulouris-Distributed-Systems-Concepts-and-Design-5th-Edition.pdf)
- Distributed Algorithms: An Intuitive Approach (http://www.amazon.com/Distributed-Algorithms-An-Intuitive-Approach/dp/0262026775/)
- Programming Distributed Computing Systems: A Foundational Approach (http://www.amazon.com/Programming-Distributed-Computing-Systems-Foundational/dp/0262018985/)
This file contains 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 reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
This file contains 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 reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
This file contains 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 reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
OlderNewer