Permalink
Browse files

Added .pair.io dir.

  • Loading branch information...
1 parent 96716bc commit ff6679b3c16261435658473a771ba9f8fb607f28 @zk committed Apr 20, 2011
View
@@ -0,0 +1,5 @@
+{
+ "size": "micro",
+ "image_id": "us-east-1/ami-7000f019",
+ "inbound_ports": [22, 80, 81, 443, 8080, 8081, 8443]
+}
@@ -0,0 +1,17 @@
+;; JDK 6
+
+(sudo
+ (apt-install :openjdk-6-jdk))
+
+;; Leiningen
+
+(sudo
+ (wget "https://github.com/technomancy/leiningen/raw/stable/bin/lein"
+ "--no-check-certificate")
+ (chmod :0755 "./lein")
+ (mv "./lein" "/usr/bin"))
+
+($ "lein")
+
+
+(run :recipes/mongo32)
@@ -0,0 +1,2 @@
+(sudo
+ (apt-install :openjdk-6-jdk))
@@ -0,0 +1,35 @@
+
+(def mongo-name "mongodb-linux-i686-1.8.1")
+(def mongo-tar (str mongo-name ".tgz"))
+(def mongo-url (str "http://fastdl.mongodb.org/linux/" mongo-tar))
+(def mongo-bin (str "/usr/share/" mongo-name "/bin"))
+(def mongo-data "/var/db/mongodata")
+
+(defn link-mongo [& names]
+ (doseq [n names]
+ (rm-f (str "/usr/bin/" (as-str n)))
+ ($ "ln -s " mongo-bin "/" n " /usr/bin/" n)))
+
+(def mongod-local
+ (str "#!/bin/bash
+mongod --dbpath " mongo-data))
+
+(def mongod-repair
+ (str "#!/bin/bash
+rm -f " mongo-data "/mongod.lock
+mongod --dbpath " mongo-data " --repair"))
+
+(sudo
+ (wget mongo-url)
+ (untar mongo-tar)
+ (rm-rf mongo-tar)
+ (mv mongo-name "/usr/share")
+ (rm-rf mongo-name)
+ (mkdir-p mongo-data)
+ (chmod :0777 mongo-data)
+ (spit (str "/usr/share/" mongo-name "/bin/mongod-local") mongod-local :0755)
+ (spit (str "/usr/share/" mongo-name "/bin/mongod-repair") mongod-repair :0755)
+ (link-mongo :mongo :mongod :mongod-local :mongod-repair))
+
+
+
@@ -107,18 +107,24 @@
:code cljs-code})
(render :json {:success true :id id}))
(render :json {:success true :id (str (:_id (mongo/insert! :code {:_id (new-bson-id)
- :code cljs-code})))})
- )))
- ["c" code-id] (index code-id)))
+ :code
+ cljs-code})))}) )))
+ ["c" code-id] (index code-id)
+ ["client" "compile"] (fn [req]
+ (try
+ (let [code (:code (json-decode (slurp (:body req))))]
+ (render :json {:js (cljs/compile-cljs-string code)}))
+ (catch Exception e
+ (-> (response (.getMessage e))
+ (status 500)
+ (header "Content-Type" "text/html")))))))
(mongo/mongo! :db :cljs-server)
(def sessions (atom {}))
(def entry-handler
(-> (var routes)
- #_(wrap-user)
- #_(wrap-bind-csrf)
(wrap-keyword-params)
(wrap-nested-params)
(wrap-params)

0 comments on commit ff6679b

Please sign in to comment.