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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<title></title> | |
<link href="/stylesheets/reset_min.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/apply.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/login.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/program.css" media="screen" rel="stylesheet" type="text/css" /> | |
<script> | |
<![-- |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<title></title> | |
<link href="/stylesheets/reset_min.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/apply.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/login.css" media="screen" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/program.css" media="screen" rel="stylesheet" type="text/css" /> | |
<script> | |
<![-- |
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
// DeferredThingy is a class that present the interface of a deferred | |
// plus provides public methods that will only run after it is resolved. | |
function DeferredThingy(opts) { | |
this.opts = opts; | |
_.extend(this, new $.Deferred()); | |
} | |
DeferredThingy.prototype.ready = function(){ | |
this.resolve(data); | |
}; |
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 learn-logic.core) | |
(use 'clojure.core.logic) | |
; an attempt to solve the classic "Send more money" problem, where | |
; S E N D | |
; + M O R E | |
; ---------- | |
; M O N E Y | |
; |
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 draggable = $("#drag"); | |
var handle = draggable.find(".handle"); | |
handle.on("mousedown.drag", function mousedown(e){ | |
handle.off("mousedown.drag"); | |
draggable.animate({ opacity: 0.5 }); | |
draggable.on("mouseup.drag", function mouseup(e){ | |
draggable.off("mouseup.drag"); | |
$("body").off("mousemove.drag"); | |
handle.on("mousedown", mousedown); |
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 Dragger = StatefulView.extend({ | |
states: { | |
"dragging": function(e){ el.css({ opacity: 0.5 }) }, | |
"inactive": function(e){ el.css({ opacity: 1 }); } | |
}, | |
transitions: { | |
"mousedown .handle": ["inactive", "dragging"], | |
"mouseup": ["dragging", "inactive"], | |
"mousemove": ["dragging", "dragging", function(e){ | |
el.css({ left: e.pageX, top: e.pageY }); |
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 Component = require("montage/ui/Component").Component; | |
var Parent = Component.specialize({ | |
thingy: { | |
value: true | |
} | |
}); | |
var Child = Parent.specialize({ | |
thingies: { |
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
describe("makeRangeContentBinder", function () { | |
it("should work", function () { | |
var o = Bindings.defineBindings({ | |
source: [1, 2, 3] | |
}, { | |
target: {"<->": "source.rangeContent()"} | |
}); | |
expect(o.target).toEqual([1,2,3]); |
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 map-state { :layers [{:selected true :title "Layer One"}, {:selected false :title "Layer Two" }]}) | |
; I want a way to write reusable components that take and update data from a cursor, | |
; where the parent decides how the data is calculated and updated. | |
(defn checkbox [checked] | |
(om/component | |
(dom/input {:type "checkbox" :checked checked | |
:onClick #(om/update! checked (not checked)}))) | |
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
(defprotocol ICursor | |
(value [self] "Get the current value of the cursor") | |
(transact [self f] "Update the current value of the cursor")) | |
(extend Atom | |
ICursor | |
(value [self] | |
(deref self)) | |
(transact [self f] | |
(swap! self f))) |
OlderNewer