Skip to content

Instantly share code, notes, and snippets.

View dandean's full-sized avatar
🌧️
It's raining.

Dan Dean dandean

🌧️
It's raining.
View GitHub Profile
var Application = {
run: function() {
document.addEventListener("deviceready", this.onDeviceReady.bind(this), false);
this.disableScrolling();
$$("div").first().fade({duration: 5});
},
onDeviceReady: function() {
},
disableScrolling: function() {
document.addEventListener("touchmove", function(e) { alert("touchmove"); e.stop(); }, false);
Element.addMethods({
/**
* Element extension to swap out one class for another on an element.
**/
swapClassName: function(element, oldClassName, newClassName) {
if (!(element = $(element))) return;
return element.removeClassName(oldClassName).addClassName(newClassName);
}
});
// Here you go Bess. Let me know if you have any questions.
/**
* ChangeMonth([e]) -> "undefined"
* - e (HTMLSelectChangeEvent): Optional, provided when this function is an event handler on a select element.
**/
function ChangeMonth(e){
// Get the select element and its current value.
var select = $('<%= this.monthListControl.ClientId_Dropdown %>'),
selectedMonth = select.value;
(function(doc) {
var getHtml = function getHtml(element) {
return $(element).outerHTML;
};
if (!('outerHTML' in doc.documentElement)) {
var dummy = doc.createElement('html');
getHtml = function getHtml(element) {
dummy.appendChild($(element).cloneNode(true));
var result = dummy.innerHTML;
Element.addMethods("INPUT", {
whatever: function(element) {
// make this shit work.
return element;
}
});
require 'net/dns/resolver'
# Custom Domain
#
# Require net-dns gem
#
# A Rack middleware to to resolve the custom domain to original subdomain
# for your multi telent application.
#
# It's all transperant to your application, it performs cname lookup and
// this:
styleSet.each(this.add, this);
// is the same as this:
styleSet.each(function(s) {
this.add(s);
}, this);
// The first one is not only shorter, but speedier
// because it has one less function in its closure chain.
Number.MIN_VALUE > 0;
// true? really? wtf.
// It turns out that MIN_VALUE is the smallest number
// GREATER THAN ZERO, which of course totally makes sense.
/**
* person = '/*-secure-\n{"name": "Violet", "occupation": "character"}\n*/'.evalJSON()
**/
#####
## INITIAL CONFIGURATION
#####
# Fork sstephenson/prototype on GitHub
# Go to this url and click the fork button. This will create a prototype
# repository under your GitHub account.
http://github.com/sstephenson/prototype