This file contains hidden or 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 hidden or 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
[myObject aMesage:5.0f]; | |
// a comment |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
;; holy crap! continuations should very much be possible! | |
(defn make-list3 [n k] | |
(if (zero? n) | |
(trampoline k '()) | |
(fn [] (make-list3 (dec n) (fn [l] #(k (conj n l))))))) | |
;; works! | |
(time (trampoline make-list3 1000000 (fn [l] l))) |
This file contains hidden or 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
;; Paul Grahams Continuation Code in Clojure | |
(def *cont* identity) | |
(defmacro =fn [parms & body] | |
`(fn [~'*cont* ~@parms] ~@body)) | |
(defmacro =defn [fn-name parms & body] | |
(let [f (symbol (str "=" fn-name))] | |
`(do | |
(defmacro ~fn-name ~parms |
This file contains hidden or 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
Function.implement({ | |
partial: function(bind, args) { | |
var self = this; | |
args = $splat(args); | |
return function() { | |
return self.apply(bind, args.concat($A(arguments))); | |
}; | |
} | |
}); |
This file contains hidden or 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
Array.implement({ | |
first: function() { | |
return this[0]; | |
}, | |
rest: function() { | |
return this.slice(1, this.length); | |
}, | |
drop: function(n) { |
This file contains hidden or 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
Document.implement({ | |
getWindow: function(){ | |
return (new Window(this.defaultView || this.parentWindow)); | |
} | |
}); | |
Window.implement({ | |
$$: function(selector){ | |
if (arguments.length == 1 && typeof selector == 'string') return (new Document(this.document)).getElements(selector); | |
var elements = []; |