This file contains hidden or 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
| ~/$ lein new ring-on-heroku | |
| Created new project in: /home/jim/Development/ring-on-heroku | |
| ~/$ cd ring-on-heroku | |
| ~/ring-on-heroku$ echo 'web: lein run -m ring-on-heroku.core' > Procfile | |
| ~/ring-on-heroku$ cat > src/ring_on_heroku/core.clj | |
| (ns ring-on-heroku.core | |
| (:use ring.util.response | |
| ring.adapter.jetty)) | |
| (defn app [req] |
This file contains hidden or 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 state-is-a-fold | |
| (:use clojure.test)) | |
| ;;; After all, state is a fold of events. For example let's say the events are a sequence of numbers | |
| ;;; and we are folding by addition: | |
| (deftest simple | |
| (let [events [1 5 2 4 3] | |
| state (reduce + events)] | |
| (is (= 15 state)))) |
This file contains hidden or 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
| /master ☣(solo)> JRUBY_OPTS=--1.9 bundle exec rake --trace | |
| rake aborted! | |
| uninitialized constant Syck::Yecht | |
| /Users/someusername/.rvm/gems/jruby-head@somecompany/gems/configatron-2.8.2/lib/configatron/store.rb:326:in `Store' | |
| /Users/someusername/.rvm/gems/jruby-head@somecompany/gems/configatron-2.8.2/lib/configatron/store.rb:2:in `Configatron' | |
| /Users/someusername/.rvm/gems/jruby-head@somecompany/gems/configatron-2.8.2/lib/configatron/store.rb:1:in `(root)' | |
| /Users/someusername/.rvm/gems/jruby-head@somecompany/gems/configatron-2.8.2/lib/configatron/store.rb:5:in `(root)' | |
| /Users/someusername/.rvm/gems/jruby-head@somecompany/gems/configatron-2.8.2/lib/configatron.rb:2:in `(root)' | |
| /Users/someusername/git/company_i_work_for/somecompany/photos/vendor/somecompany/foreignclient/lib/module_helpers.rb:3:in `(root)' | |
| /Users/someusername/git/company_i_work_for/somecompany/photos/vendor/somecompany/foreignclient/lib/foreignclient.rb:12:in `(root)' |
This file contains hidden or 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 demo.gemstoclojure | |
| (:require [ring.adapater.jetty :as jetty] | |
| [clojure.contrib.io :as io] | |
| [clojure.contrib.classpath :as cp]) | |
| (:import [org.jruby.embed ScriptingContainer LocalContextScope])) | |
| (def container (ScriptingContainer. LocalContextScope/THREADSAFE)) | |
| (println (cp/classpath)) | |
| (println (io/pwd)) |
This file contains hidden or 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 blog.core | |
| (:require [ring.adapter.jetty :as jetty] | |
| [clojure.contrib.io :as io] | |
| [clojure.contrib.classpath :as cp]) | |
| (:import [org.jruby.embed ScriptingContainer LocalContextScope])) | |
| (def scripting-container (ScriptingContainer. LocalContextScope/THREADSAFE)) | |
| (defn execute-rb [rb-string] | |
| (. scripting-container runScriptlet rb-string)) |
This file contains hidden or 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 routes | |
| (-> (app | |
| ["examples" text] {:get [(fn [req] (walton-html text))]} | |
| [#".*\.js"] {:get [(file-response "resources/public")]} | |
| [#".*\.css"] {:get [(file-response "resources/public")]}) | |
| (wrap-file "resources/public"))) |
This file contains hidden or 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
| age = 26 | |
| name = "Devin" | |
| 1.upto(5) do |age;name| | |
| age = 100 | |
| name = "Rip Van Winkle" | |
| puts "#{name} is #{age} years old" | |
| end | |
| puts age # => 26 |
This file contains hidden or 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
| ______________ | |
| ,,--''::::::::::::::`-.___ | |
| ,--'::::::::::::::::::::::::::`-._ | |
| ,-'::::::::::::::::::::::::::::::::::`-. | |
| ,-'::::::::::::::::::::::::::::::::::::::::`. | |
| ,':::::::::::::::::::::::::::::::::::::::::::::`-. | |
| ,':__________:::::::::::::::::::::::::::::::::::::::\ | |
| /__/ `-._::________________::::::::::::::::::`. |
This file contains hidden or 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
| .. .. .. .. .... .. . . .. . . ... . ... . . .. .. .. .. .. .... .. | |
| . . .. . . ... . ... . . .. .. .. .. .. .... .. . . .. . . ... . ... | |
| . . .. .. .. .. .. .... .. 8@8@88@8@8@888 . ... . . .. .. .. .. .. | |
| .... .. . . .. . . ... .@@888@8@8@@88@88@@@88@@@88@.. .... .. . . .. . . ... | |
| . ... . . .. .. .8@@@88@88@8888@88@@8@8@88@8@8@888@@. ... . . .. .. .. | |
| .. .. .... .. . 8@88@8@8@888@@8@@888@8@8@@88@88@@@88@@@88o.. .... .. . . .. | |
| . . ... . ... .@8@@88@88@@@88@@@88@88@8888@88@@8@8@88@8@8@888 . ... . . .. | |
| .. .. .. .8@8888@88@@8@8@88@8@8@888@@8@@888@8@8@@88@88@@@88@@ .. .. .... .. | |
| . . .. . . 888 . ... . .@@88@88@@@88@@@88@88@8888@88@@8@8@88@8@8 ... . ... | |
| . . .. .. .. .. .. .... .c . . .. . . ... 8@@888@8@8@@88@88@@@.. .. .. |
This file contains hidden or 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
| qQQggggWWWWWWWBgggpQQ, | |
| qggdWWWWWWWWWWWWWWWWWWWWWWWWgpQ, | |
| QgWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWBpQ | |
| QgWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWp, | |
| \g#WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWBp | |
| \gWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWBp | |
| gWW"""\ 7"""WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWBp | |
| " "W"" ""WWWWWWWWWWWWWWWWWWWk, | |
| ,,,, "WWWWWWWWWWWWWWWWWB, | |
| QQQgggpQ, JEEEEEEEEENmqQ, "MWWWWWWWWWWWWWWWp |