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 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}) | |
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
(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)))]])) |
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
(defn flatten [s] | |
(remove seq? (tree-seq seq? seq s))) |
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
{ | |
"env": { | |
"default": { | |
"db": "http://[adminusername]:[adminpassword]@localhost:5984/wear" | |
} | |
} | |
} |
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
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 |
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 'rest_client' | |
require 'json' | |
class Couch | |
def initialize(url) | |
@db = url.gsub(/\/$/, '') | |
end | |
# Updates the given doc by yielding the current state of the doc | |
# and trying to update update_limit times. Returns the new doc |
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
#! /usr/bin/python | |
import sys | |
import Image | |
def corners(image, test_square_size = 1): | |
"""returns an array of the corner bounds of the image""" | |
size_x, size_y = image.size | |
max_x, max_y = (size_x-1, size_y-1) | |
if max_x < test_square_size or max_y < test_square_size: | |
raise Exception, 'test_square_size cannot be larger than the image size' |
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
git stash | |
git checkout -b new-branch |
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
git commit -a -m 'finished implementing x, still need y and z' | |
git checkout bug-branch | |
git stash pop |
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
git commit -a -m 'done changing the world' | |
git checkout bug-branch | |
git merge new-branch |
OlderNewer