Skip to content

Instantly share code, notes, and snippets.

View brentonashworth's full-sized avatar

Brenton Ashworth brentonashworth

View GitHub Profile
$(function() {
$("#hire-date").datepicker({dateFormat: 'yy-mm-dd'});
$("#language").autocomplete({source: "langs-autocomplete"});
});
$(function() {
$("#hire-date").datepicker({dateFormat: 'yy-mm-dd'});
});
(def properties
{:username "Username"
:password "Password"})
(def security-policy
[#"/admin.*" :admin
#"/permission-denied.*" :any
#"/login.*" :any
#".*\.(css|js|png|jpg|gif)$" :any
#".*" #{:admin :user}])
@brentonashworth
brentonashworth / gist:574594
Created September 11, 2010 00:21
Sandbar forms
;; Use sandbar to create forms. Create routes, validate input, display error messages,
;; marshal form data, etc. More documentation and examples coming soon.
(defn password-strength [m]
(if (< (count (:password m)) 10)
(add-validation-error m :password properties)
m))
(def validator
(build-validator
@brentonashworth
brentonashworth / test.clj
Created December 3, 2009 06:38
Clojure Test Runner
(ns com.formpluslogic.util.test
(:use [clojure.test]
[clojure.test :only (run-tests)]
[com.formpluslogic.util.file_utils]))
(def test-dir "test")
(def test-file-prefix "test_")
(def test-file-ext ".clj")
(def *logging* false)
@brentonashworth
brentonashworth / clj.rb
Created December 3, 2009 04:59
Ruby Script to run Clojure
#!/usr/bin/env ruby -wKU
JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
JAVA="#{JAVA_HOME}/bin/java"
GIT_ROOT=ENV['GIT_ROOT']
CLJ="/opt/clojure"
LIB="#{GIT_ROOT}/library"
classpath=".:src:test:classes" +
":#{GIT_ROOT}/formpluslogic/fpl-clojure-util/fpl-clojure-util.jar" +
":#{CLJ}/swank-clojure/src/"