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
Spry.Data.DataSet.sortInstructions = {}; | |
Spry.Data.DataSet.sortInstructions['number'] = function( prop ){ | |
return { | |
ascending:function(a, b) | |
{ | |
a = a[prop]; b = b[prop]; | |
if (a == undefined || b == undefined) | |
return (a == b) ? 0 : (a ? 1 : -1); | |
return a-b; | |
}, |
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
Spry.Utils.liveListener = function( eventType, root, capture ){ | |
var that = this; | |
Spry.Utils.Notifier.call( that ); | |
that.root = root || document.documentElement; | |
that.eventType = eventType || "click"; | |
Spry.Utils.addEventListener( that.root, eventType, function( evt ){ | |
var target = evt.target || evt.srcElement, |
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(){ | |
if( function(){ var input = document.createElement( "input" ); return ( "placeholder" in input )}() ) | |
return; | |
Spry.$$( "input[placeholder]", document.body ).forEach( function( e ){ | |
var current = e.attributes.getNamedItem( "placeholder" ).value; | |
if( !e.value ){ | |
e.value = current; | |
// add special place holder class for styling... |
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( doc, rxp ){ | |
var scripts = doc.getElementsByTagName("script"), i = scripts.length, tmp; | |
while( i-- ){ | |
if( scripts[i].type == "text/spry" && scripts[i].id.match( rxp ) ){ | |
tmp = doc.getElementById( scripts[i].id.replace( rxp, "" ) ) | |
tmp.innerHTML = scripts[i].innerHTML; | |
Spry.Data.initRegions( tmp ); | |
} | |
} | |
}( document, /replace_/)) |
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 fs = require('fs'), | |
sys = require('sys'); | |
fs.readFile( './test/user_agent_data.csv', function( err, result ){ | |
( result.split( "\n" ) ).forEach( function(){ | |
sys.puts( arguments[2] ); | |
}); | |
}); |
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
Spry.$$ = function( selectorSequence, rootNode ) | |
{ | |
var matches = []; | |
Spry.$$.addExtensions( matches ); | |
// If the first argument to $$() is an object, it | |
// is assumed that all args are either a DOM element | |
// or an array of DOM elements, in which case we | |
// simply append all DOM elements to our special |
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
Spry.Data.XMLDataSet.evaluateXPath = function( contextNode, xpath ){ | |
var results = [], | |
parser, i, length, tmp; | |
// Quit processing if we don't even have sufficient data to process | |
if( !( contextNode && xpath ) ) return results; | |
// Check if the Google Xpath library is available. If it's included it's | |
// usually an indication that user wants to use it as default. | |
if( window.ExprContext && window.xpathParse ){ |
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
#!/usr/bin/python2.4 | |
import os, re | |
import logging | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import util | |
from cssmin import compressor | |
class test(webapp.RequestHandler): | |
def get(self): | |
self.response.headers['content-type'] = 'text/html' |
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 zip = require('./zip'), | |
sys = require('sys'), | |
fs = require('fs'); | |
fs.readFile( '/etc/hosts', function( err, res ){ | |
var data = res.toString(), | |
unzip = data.length, | |
start = +new Date, | |
deflate = zip.deflate( data ), | |
zipper = deflate.length, |
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 net = require('net'), | |
sys = require('sys'); | |
var stream = new net.Stream(); | |
stream.addListener( 'connect', function(){ | |
this.setTimeout( 0 ); | |
this.setNoDelay( true ); | |
}); |
OlderNewer