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
| (let [name "test"] | |
| (cond | |
| (= "test" name) | |
| (do-this) | |
| (= "that" name) | |
| (do-that) | |
| :else | |
| (do-other))) |
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
| (require 'clojure-mode) | |
| (require 'slime) | |
| (require 'slime-repl) | |
| (require 'paredit) | |
| (require 'midje-mode) | |
| (autoload 'clojure-mode "clojure-mode" "A major mode for Clojure" t) | |
| (add-to-list 'auto-mode-alist '("\\.clj$" . clojure-mode)) | |
| (add-to-list 'auto-mode-alist '("\\.cljs$" . clojure-mode)) |
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
| (defpartial search-input [{:keys [query]}] | |
| (label "query" "Search by Input: ") | |
| (text-field "query" query)) | |
| (defpartial search-value [{:keys [query]}] | |
| (label "query" "Search by Output: ") | |
| (text-field "query" query)) | |
| (defpage "/" {:as query} | |
| (common/layout |
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 slim.core | |
| (:require [clojure.java.io :as io] | |
| [clojure.string :as s])) | |
| (defstruct html-node :depth :interpreted_type :interpreted :selector :attributes :content) | |
| (defn- process-line [acc line] | |
| (let [[full-text | |
| directive | |
| leading_whitespace |
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 two-songs.core | |
| (:use [overtone.live] | |
| [overtone.inst.sampled-piano]) | |
| (:require [overtone.music.pitch :as pitch])) | |
| (def metro (metronome 120)) | |
| (def chord-seq [(pitch/chord :e4 :major) | |
| (pitch/chord :c#4 :minor7) | |
| (pitch/chord :f#4 :minor7) |
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
| class Document < ActiveRecord::Base | |
| after_save :index_record | |
| before_destroy :remove_from_index | |
| private | |
| def to_solr | |
| #TODO - implement a hash serialization of this record | |
| end | |
| def index_record | |
| SolrService.add(self.to_solr) |
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
| rsolr = RSolr.connect(:url => 'http://127.0.0.1:8983/solr') | |
| rsolr.add([{"id" => 10, "policy_area_texts" => "Health", "summary_texts" => "Everything about health"}, {"id" => 11, "policy_area_texts" => "Magic", "summary_texts" => "What magicians do"}]) | |
| rsolr.commit | |
| # <dynamicField name="*_texts" stored="true" type="text" multiValued="true" indexed="true"/> |
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
| dev/blacklight master (solo)> ./test_support/bin/test.sh | |
| /Users/plato/.rvm/gems/ruby-1.9.3-p194@blacklight/gems/bundler-1.1.5/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find chunky_png-1.2.6 in any of the sources (Bundler::GemNotFound) | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p194@blacklight/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `map!' | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p194@blacklight/gems/bundler-1.1.5/lib/bundler/spec_set.rb:83:in `materialize' | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p194@blacklight/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs' | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p194@blacklight/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs' | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:41:in `candidate?' | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:60:in `setup' | |
| from /Users/plato/.rvm/gems/ruby-1.9.3-p19 |
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
| dev/blacklight master (solo)> ./test_support/bin/test.sh | |
| Usage: | |
| rails new APP_PATH [options] | |
| Options: | |
| -r, [--ruby=PATH] # Path to the Ruby binary of your choice | |
| # Default: /Users/plato/.rvm/rubies/ruby-1.9.3-p194/bin/ruby | |
| -b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL) | |
| -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL) | |
| [--skip-gemfile] # Don't create a Gemfile |
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
| (use '[datomic.api :as d]) | |
| (def uri "datomic:free://localhost:4334/git") | |
| (def conn (d/connect uri)) | |
| (def rules | |
| '[[(node-files ?n ?f) [?n :node/object ?f] [?f :git/type :blob]] | |
| [(node-files ?n ?f) [?n :node/object ?t] [?t :git/type :tree] | |
| [?t :tree/nodes ?n2] (node-files ?n2 ?f)] | |
| [(object-nodes ?o ?n) [?n :node/object ?o]] | |
| [(object-nodes ?o ?n) [?n2 :node/object ?o] [?t :tree/nodes ?n2] (object-nodes ?t ?n)] | |
| [(commit-files ?c ?f) [?c :commit/tree ?root] (node-files ?root ?f)] |