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
zak@bigbox ceilingbounce $ lein with-profile lean do clean, droid doall | |
Generating manifest... | |
Generating R.java files... | |
Compiling 3 source files to /media/zak/bd07aeae-4895-4289-88fe-329b1b7b92a2/code/ceilingbounce/target/classes | |
Compiling Clojure files... | |
Build type: debug, dynamic compilation: enabled, remote REPL: enabled. | |
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: clojure.core/*lean-var?* in this context, compiling:(/tmp/form-init52165355158824598.clj:1:269) | |
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6740) | |
at clojure.lang.Compiler.analyze(Compiler.java:6534) | |
at clojure.lang.Compiler.analyze(Compiler.java:6495) |
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
(first-truthy | |
(get-it-from-the-cache) | |
(get-it-from-the-network) | |
(ask-the-user) | |
(make-up-random-value) |
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
(defmacro silence-errors [& body] | |
"Evaluate body and return the result, or nil if an exception is thrown" | |
`(try ~@body | |
(catch Exception e#))) | |
(defmacro first-truthy [& body] | |
"Try some expressions; return the result of the first one that neither throws an exception or returns false or nil" | |
(cons 'or (map (fn [item] | |
(list 'silence-errors item)) | |
`~body))) |
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
(defmacro silence-errors [& body] | |
"Evaluate body and return the result, or nil if an exception is thrown" | |
`(try ~@body | |
(catch Exception e#))) | |
(defmacro first-truthy [& body] | |
"Try some expressions; return the result of the first one that neither throws an exception or returns false or nil" | |
(cons 'or (map (fn [item] | |
(list 'silence-errors item)) | |
`~body))) |
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
description "train the spam filter" | |
instance $x | |
stop on reddit-stop or runlevel [016] | |
respawn | |
respawn limit 10 5 | |
nice 10 |
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
(defdb db | |
(postgres {:password "a-password", :user "timeline", :db "timeline"}) | |
(defentity tag | |
(database db) | |
(table :tags) | |
(pk :tag)) | |
(sql-only (select tag)) |
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
(defn user-feedback [user-id] | |
(-> (select users (where (= :users.id user-id))) | |
(join items (where (= :items.user_id :users.id))) | |
(join reservations (where (or (= :renter :users.id) | |
(= :item :items.id)))) | |
(join feedback (where (= :reservation :reservations.id))) | |
distinct | |
(project [:feedback.id :feedback.reservation :feedback.score :feedback.sender :feedback.comment]))) |
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
(def bot-name "irclj_bot_test") | |
(def irc-server "irc.freenode.net") | |
(def irc-channel "#clojure") | |
(def msgs (agent [])) | |
(def info (agent [])) | |
(defn log-info [{:keys [nick channel message irc errors doing]}] | |
(send info conj message)) |
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
#app/models/document.rb | |
class Document < ActiveRecord::Base | |
has_attached_file :attachment, styles: {html: {}}, :processors => [:htmlprocessor] | |
attr_accessor :attachment_file_name | |
end | |
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
Started POST "/documents" for 127.0.0.1 at 2011-10-21 20:52:27 -0400 | |
Processing by DocumentsController#create as HTML | |
Parameters: {"Filename"=>"Contract.odt", "_urcollege_session"=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWIxODBkMTJhOWNlMDg1ZTY1NzZiZWM5ZGUxYjgxNGMxBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMXM0bzNzY3Z3TWE4WVh6UGZXandkRzJvTFkvVjJvcWNDRUo0M1JjQ1dnTUk9BjsARg==--4e8e0ce753d8618b22cc2e18e80bc753b4831f35", "authenticity_token"=>"s4o3scvwMa8YXzPfWjwdG2oLY/V2oqcCEJ43RcCWgMI=", "folder"=>"/documents/", "attachment"=>#<ActionDispatch::Http::UploadedFile:0x0000000588afe0 @original_filename="Contract.odt", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"attachment\"; filename=\"Contract.odt\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<File:/tmp/RackMultipart20111021-29558-ungtwg>>, "Upload"=>"Submit Query"} | |
(0.1ms) BEGIN | |
SQL (5.1ms) INSERT INTO "documents" ("attachment", "created_at", "processed", "updated_at") VALUES ($1, $2, $3, $4) RETURNING "id" [ |
NewerOlder