Skip to content

Instantly share code, notes, and snippets.

View pierrel's full-sized avatar

Pierre Larochelle pierrel

  • LinkedIn
  • San Francisco, CA
View GitHub Profile
var Mannequin = new Object();
Mannequin.element_id = 'mannequin-canvas';
Mannequin.shirt_id = '';
Mannequin.pant_id = '';
Mannequin.shoes_id = '';
Mannequin.last_piece_hover = ''; // The last piece the mouse was over, to detect changes
{
"env": {
"default": {
"db": "http://[adminusername]:[adminpassword]@localhost:5984/wear"
}
}
}
(defn flatten [s]
(remove seq? (tree-seq seq? seq s)))
(def people-view
(html [:html
[:h1 "People"]
[:ul
(let [rows '({:id 1 :name "johanna"} {:id 2 :name "vincent"})]
(reduce html
(map (fn [hash] [:li (str (get hash :id) " - " (get hash :name))]) rows)))]]))
@pierrel
pierrel / clojure and sqlite
Created February 2, 2009 05:39
How to use sqlite with clojure
(ns something
(:require [clojure.contrib.sql :as sql]))
; Give the sql library all the information about the db
; to be used in transactions
(def db {:classname "org.sqlite.JDBC"
:subprotocol "sqlite" ; Protocol to use
:subname "db/db.sqlite3" ; Location of db
:create true})