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
read | |
---- | |
{ | |
"action": "read", | |
"table": "user/shift/trail/comment", | |
"constraints": { | |
"user_id": 67 | |
}, | |
"properties": "*" || ["username", "summary", "modified"], | |
"orderby": ["<" || ">", "modified"], |
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 TestTwoSpace = ShiftSpace.Space.extend({ | |
attributes: { | |
name: 'TestTwo', | |
icon: 'TestTwo.png' | |
} | |
}); | |
var TestTwoShift = ShiftSpace.Shift.extend({ | |
setup: function(json) { | |
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 TestTwoSpace = ShiftSpace.Space.extend({ | |
attributes: { | |
name: 'TestTwo', | |
icon: 'TestTwo.png' | |
} | |
}); | |
var TestTwoShift = ShiftSpace.Shift.extend({ | |
setup: function(json) { | |
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 TestTwoSpace = ShiftSpace.Space.extend({ | |
attributes: | |
{ | |
name: 'TestTwo', | |
icon: 'TestTwo.png' | |
} | |
}); | |
var TestTwoShift = ShiftSpace.Shift.extend({ | |
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
[ | |
{ | |
"action": "read", | |
"table": "workset", | |
"properties": "*", | |
"constraints": { | |
"userid": "4511" | |
}, | |
"orderby": [ | |
">", |
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
(import [java.security MessageDigest]) | |
(def *sha1* "SHA-1") | |
(def *abc* (.getBytes "ABC")) | |
(def *abc-sha1* "3c1bdbb26f358bab27f267924aa2c9a3fcfdb8") | |
(defn start-message-digest [type] | |
(MessageDigest/getInstance type)) | |
(defn update-message-digest [#^MessageDigest md bytes] |
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
; Amaturish Clojure version of uniprot mapping function by @sjcockell | |
; Improved a bit by David Nolen | |
; http://blog.fuzzierlogic.com/archives/339 | |
; http://gist.github.com/329730 | |
(ns uniprot | |
(:use [clojure.contrib.duck-streams]) | |
(:require [clojure.contrib.str-utils2 :as s]) | |
(:import java.net.URLEncoder)) | |
(defn- url-encode [param] (URLEncoder/encode param)) |
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
;; this file is a walkthrough of Moustache features, a web framework for Clojure | |
;; http://github.com/cgrand/moustache/tree/master | |
;; Moustache allows to declare routes, apply middlewares and dispatch on http methods. | |
;; Moustache is compatible with all frameworks built on Ring, including Compojure | |
(ns demo | |
(:use net.cgrand.moustache) | |
(:use [ring.adapter.jetty :only [run-jetty]])) ;; hmmm Ring without servlets |
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 defn-test | |
(:use clj-html.core | |
[net.cgrand.moustache :only [app]] | |
[ring.adapter.jetty :only [run-jetty]] | |
[ring.util.response :only [response]])) | |
(defhtml application [text body] | |
[:html | |
[:head | |
[:title text]] |
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
(definterface IntToIntFn | |
(#^int call [^int n])) | |
(def fibr | |
(let [one (int 1) | |
two (int 2)] | |
(reify | |
IntToIntFn | |
(call [this n] | |
(if (>= one n) one (+ (.call this (dec n)) (.call this (- n two)))))))) |
OlderNewer