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
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 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 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 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 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 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 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 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 interface.boot | |
"This namespace is only used while developing | |
to start and stop an internal webserver." | |
(:use [ring.adapter.jetty :only [run-jetty]] | |
[ring.middleware.stacktrace :only [wrap-stacktrace]]) | |
(:require [interface.routes :as routes]) | |
(:gen-class)) | |
(def ^:dynamic *port* 8081) |
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
require 'formula' | |
class Lush < Formula | |
url 'http://downloads.sourceforge.net/project/lush/lush2/lush-2.0.1.tar.gz' | |
homepage 'http://lush.sourceforge.net/' | |
md5 '35547934a3038a34ef64272cec51c60b' | |
def install | |
# will not build 64-bit | |
ENV.m32 |
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
src/lush-2.0.1> make | |
for d in src ; \ | |
do ( cd $d && make all ) || exit ; done | |
g++ -DHAVE_CONFIG_H -DNO_DEBUG -Wall -O3 -mmmx -msse -I../include -I/usr/X11/include -I/usr/X11/include/freetype2 -o lush2 at.o binary.o cref.o calls.o arith.o check_func.o date.o dh.o dump.o eval.o fileio.o fltlib.o fpu.o function.o event.o graphics.o htable.o idx1.o idx2.o idx3.o idx4.o index.o io.o list.o main.o math.o misc.o cmm.o module.o number.o oostruct.o regex.o storage.o string.o symbol.o toplevel.o user.o weakref.o ps_driver.o rng.o lisp_driver.o x11_driver.o unix.o cpp.o -L/usr/X11/lib -lXft -R/usr/X11/lib -lSM -lICE -lX11 -lreadline -lcurses -lutil -ldl -lm | |
Undefined symbols for architecture x86_64: | |
"_FcNameParse", referenced from: | |
_getfont in x11_driver.o | |
"_FcPatternDestroy", referenced from: | |
_getfont in x11_driver.o | |
"_FcPatternGet", referenced from: |