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
(declare explore-map) | |
(declare explore-vector) | |
(declare explore-seq) | |
(defn explore | |
"Safely explore possibly large map/vector structures in the repl. | |
morv - map or vector or seq | |
threshold - if count is under threshold, recursively explore | |
peekn - if over threshold, recursivley explore peekn entries | |
and summarize rest" | |
[morv threshold peekn] |
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
[ hby@Guardian ~/dev/ClojureScript/mac-command-line/planck-demo ] ls | |
script.cljs unsorted.txt | |
[ hby@Guardian ~/dev/ClojureScript/mac-command-line/planck-demo ] cat script.cljs | |
#! /Users/hby/bin/planck | |
(->> | |
(slurp "unsorted.txt") | |
(re-seq #"\w+") | |
sort | |
(#(interleave %1 (cycle "\n"))) |
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
[ hby@Guardian ~/dev/MetaBahn/gits/cwb-rails-2 (git::dgm-works-with-frontend) ] bundle exec rails s | |
=> Booting Thin | |
=> Rails 4.1.2 application starting in development on http://0.0.0.0:3000 | |
=> Run `rails server -h` for more startup options | |
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option) | |
=> Ctrl-C to shutdown server | |
Exiting | |
/Users/hby/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/railties-4.1.2/lib/rails/application/configuration.rb:105:in `database_configuration': Cannot load `Rails.application.database_configuration`: (RuntimeError) | |
Could not load database configuration. No such file - | |
from /Users/hby/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activerecord-4.1.2/lib/active_record/railtie.rb:128:in `block (2 levels) in <class:Railtie>' |
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 haglure.core | |
(:require [net.cgrand.enlive-html :as html])) | |
(def layout | |
(html/html-resource "test.html")) | |
(defn scope [n] | |
(:data-scope (:attrs n))) | |
(def scopes (html/select layout [(html/attr? :data-scope)])) |
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
; As I was reading about multimethods I began to wonder if they | |
; would be a reasonable way to organize code that would normally | |
; do a table lookup based on some data in order to get at something | |
; (like a function in the Clojure case) to use to continue to process | |
; the data. There are times that I like to set up a table with functioanlity | |
; that can be keyed into in lieu of explicit conditional code. But that's | |
; beside the point. I wondered if there would be a significant difference | |
; in performance. If my memory is correct, Richard O'Keefe in The Craft of | |
; Prolog instilled in me that the only way to know these things is to | |
; benchmark them. I'm glad I did. I was a little surprised. |