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
dc.ui.Dialog = dc.View.extend({ | |
className : 'dialog', | |
callbacks : [ | |
['.cancel', 'click', 'cancel'], | |
['.ok', 'click', 'confirm'] | |
], | |
constructor : function(options) { |
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
(function(){ | |
var square = function(x) { | |
return (x * x); | |
}; | |
var sum = function(x, y) { | |
return (x + y); | |
}; | |
var odd = function(x) { | |
return ((x % 2) === 0); | |
}; |
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
# TODO: Think of a name for this crazy thing. | |
# Functions: | |
square: x => x * x. | |
sum: x, y => x + y. | |
odd: x => x % 2 is 0. | |
even: x => x % 2 aint 0. |
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
// Handles JavaScript history management and callbacks. To use, register a | |
// regexp that matches the history hash with its corresponding callback: | |
// | |
// dc.history.register(/^#search/, controller.runSearch); | |
// | |
// And then you can save arbitrary history fragments. | |
// | |
// dc.history.save('search/freedom/p3'); | |
// | |
DV.history = { |
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
$.fn.extend({ | |
draggable : function() { | |
this.each(function() { | |
var drag = _.bind(function(e) { | |
e.stopPropagation() && e.preventDefault(); | |
this.style.left = this._drag.left + event.pageX - this._drag.x + 'px'; | |
this.style.top = this._drag.top + event.pageY - this._drag.y + 'px'; | |
}, this); |
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
// Handles JavaScript history management and callbacks. To use, register a | |
// regexp that matches the history hash with its corresponding callback: | |
// | |
// dc.history.register(/^#search/, controller.runSearch); | |
// | |
// And then you can save arbitrary history fragments. | |
// | |
// dc.history.save('search/freedom/p3'); | |
// | |
DV.history = { |
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
START_COORDS = [500, 500] | |
def setup | |
size 500, 500 | |
no_fill | |
smooth | |
color_mode HSB, 255 | |
@stop = false | |
@step_counter = 0 | |
@dj = DeJongAttractor.new |
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
$.fn.extend({ | |
// When the next click or keypress happens, anywhere on the screen, hide the | |
// element. 'clickable' makes the element and its contents clickable without | |
// hiding. The 'onHide' callback runs when the hide fires, and has a chance | |
// to cancel it. | |
autohide : function(options) { | |
var me = this; | |
options = _.extend({clickable : null, onHide : null}, options || {}); | |
me._autoignore = 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
require 'strscan' | |
module DC | |
module Import | |
# Supported formats: | |
# | |
# 10/13/2009 (10-13-2009) | |
# 10/13/09 (10-13-09) | |
# 2009/10/13 (2009-10-13) |