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
javascript:(function(){var e={},t,n={},r=(prompt("Ignore filter (comma sep)?","")||"").split(","),i=r.length,s=document.createElement("iframe"),o="";while(i--){n[r[i]]=1}for(i in window){if(window[i]!==undefined){e[i]={type:typeof window[i],val:window[i]}}}s.style.display="none";document.body.appendChild(s);s.src="about:blank";s=s.contentWindow||s.contentDocument;for(i in e){if(typeof s[i]!="undefined")delete e[i];else if(n[e[i].type])delete e[i]}t="addEventListener,document,location,navigator,window".split(",");i=t.length;while(--i){delete e[t[i]]}var u=[];for(i in e){u.push(i)}alert(u.length?"Found these globals: "+u.join(", ")+". See details in the console!":"No globals found!");console.dir(e)})() |
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
Drupal.verticalTabs = Drupal.verticalTabs || {}; | |
Drupal.settings.verticalTabs = Drupal.settings.verticalTabs || {}; | |
Drupal.behaviors.verticalTabs = function() { | |
if (!$('.vertical-tabs-list').size() && Drupal.settings.verticalTabs) { | |
var TABSETTING = "tabpos"+document.location.pathname.replace(/\//g,666); | |
var ul = $('<ul class="vertical-tabs-list"></ul>'); | |
var panes = $('<div class="vertical-tabs-panes"></div>'); | |
$.each(Drupal.settings.verticalTabs, function(k, v) { | |
var summary = '', cssClass = 'vertical-tabs-list-' + k; |
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
/* | |
S A N I T A R Y V I E W P U B L I C A T I O N P A T T E R N | |
This pattern adresses three issues; memory leaks, involuntarily allowing unwanted event listeners to live | |
on, and the cumbersome process of publishing a view to the page. The first two issues are dealt with through | |
making sure that previously published views are removed properly, and not merely have their html | |
overwritten. And, as will see, the solution to fixing the removal process will also mean a streamlining | |
of the publication process! | |
We do this through the use of two mixin modules; one for our views, and one for our router. |
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
// Compare classic insert, insert using Begin/Commit and Union insert described slightly down on this page: http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database | |
// Create some values | |
var values = []; | |
for(var i = 0; i < 500; i++){ | |
values.push(i); | |
values.push(String.fromCharCode(65 + i % 25)); | |
} |
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
# ----------------------------- jquerified DOM references --------------------------- | |
ui = {} | |
ui[id] = $("##{id}") for id in ["input","output","response","history","current","savebtn","examples","clearhistorybtn","clearbtn"] | |
ui.currentstring = $ "#current .string" | |
ui.currentobjprint = $ "#current .objprint" | |
# -------------------------- variables/constans ----------------------------------- |
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
calc = (tool,a1,a2,toolarg)-> | |
if tool is "relation" | |
throw "Only one relation allowed!" if a2.type is "relation" | |
type:"relation",objs:[a1,a2],val:toolarg | |
else if a2.type is "relation" | |
type: "relation",val:a2.val, objs:[calc(tool,a1,a2.objs[0]),a2.objs[1]] | |
else if a2.isblock | |
o tool,[a1,a2] | |
else if tool in ["sum","product"] and tool is a2.type | |
o tool, [a1].concat a2.objs |
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
tests.addBatch "the calc function": | |
"is defined": -> assert.isFunction calc | |
"when relating": | |
topic: -> (arg)-> calc "relation", start, arg, "eq" | |
"a blob": | |
topic: (relate)-> relate blob | |
"we get a": type "relation" | |
"containing": objs [start, blob] | |
"with a value": val "eq" | |
"a relation": (relate)-> assert.throws -> relate relation |
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
tests.addBatch "the implicit operation function": | |
"is defined": -> assert.isFunction iO | |
"returns product for": pairs "1x", "2y", "3z", "5(", "0x", ")(", "xy", "5\"", "x\"", "\"y","\"\"", "5|", "||", "!x" | |
"returns power for": pairs "x2", "y3", "z4", ")6", "\"2", "\"8", "|2", "x0", "!2" | |
"returns sum for": pairs "3-", "z-", ")-", "\"-" | |
"returns nothing for": wrongpairs "3+", "x*" |
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 typeof exports is "undefined" | |
exportTo = @parser = {} | |
else | |
exportTo = exports |