My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}| cd ~ | |
| sudo apt-get update | |
| sudo apt-get install openjdk-7-jre-headless -y | |
| wget https://github.com/elasticsearch/elasticsearch/archive/v0.20.1.tar.gz -O elasticsearch.tar.gz | |
| tar -xf elasticsearch.tar.gz | |
| rm elasticsearch.tar.gz | |
| sudo mv elasticsearch-* elasticsearch | |
| sudo mv elasticsearch /usr/local/share |
| 102 | |
| 103 server { | |
| 104 listen 80; | |
| 105 server_name bookmarking.curtis.io; | |
| 106 | |
| 107 location / { | |
| 108 expires 24h; | |
| 109 proxy_pass http://localhost:3000/; | |
| 110 sendfile on; | |
| 111 proxy_redirect off; |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}| (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 *@*.*" |
| #!/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) |
| ;; (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] |
| (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 |
| (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)) |