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 'rubygems' | |
require 'sinatra' | |
configure do | |
Cache = {} # Create a new cache | |
end | |
helpers do | |
def menu_helper | |
sleep 3 # delay to demonstrate cache speedup... |
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 data = "Core Core Selectors Attributes Traversing Manipulation CSS Events Effects Ajax Utilities".split(" "); | |
$(".autocomplete").autocomplete(data, {minChars: 0}); | |
function append_message(text) { | |
if ($(".ac_results").find("span").length == 0) { | |
$(".ac_results").append("<span>"+text+"</span>"); | |
}; | |
}; | |
$(".autocomplete").keyup(function(){ |
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
/* | |
* jquery.tamperframe.js | |
* v 0.1 | |
* | |
* Initial Author | |
* John Griffiths | |
* | |
* Description | |
* Simpy watches an element for changes, if any encountered flips the flag. | |
* If the exit button is clicked and the flag is true a dialog appears warning user will lose changes. |
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
// detect Internet Explorer and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check) | |
// | |
// author: Scott Jehl | |
// | |
// http://gist.github.com/scottjehl | |
// | |
// version arg is for IE version (optional) | |
// comparison arg supports 'lte', 'gte', etc (optional) | |
// | |
// is it IE? |
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
// http://jsperf.com/ie | |
// Conditional Comment | |
ie = (function() { | |
var v = 3, | |
div = document.createElement('div'); | |
while ( | |
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', div.getElementsByTagName('i')[0]); | |
window.status = v; |
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
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} | |
// And to detect the version: | |
// ie === 6 // IE6 | |
// ie> 7 // IE8, IE9 ... |
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() { | |
try { | |
if (!google.doodle) google.doodle = {}; | |
var a = 200, | |
g = -200, | |
j = -200, | |
k, | |
l, | |
m, | |
n = 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
font:100%/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif; |
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
http://html5doctor.com/draw-attention-with-mark/ | |
mark { | |
background-color : #ff9; | |
color : rgb(0,0,0); | |
font-style : italic; | |
font-weight : bold; } | |
--------------------- |
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
// when using the jquery.validation plugin with a tinymce textarea you will need to write the contents of the tinymce area back into the original textarea for jquery.validation to pick up it's new value | |
// force tinymce content to be written back into original textarea element | |
var content = tinyMCE.activeEditor.getContent(); | |
$("textarea.tinymce").val(content); | |
// if all else fails | |
tinyMCE.triggerSave(); | |
after this you can safely apply jquery validation ala... |