Skip to content

Instantly share code, notes, and snippets.

View chrisgeo's full-sized avatar

Chris George chrisgeo

  • San Francisco, CA
View GitHub Profile
YUI.add('paginator', function(Y){
Y.Test = Y.namespace('Test');
Y.Test = Y.Base.create('test', Y.Widget, [Y.WidgetParent, Y.WidgetChild], {
CONTENT_TEMPLATE: '<ul></ul>'
});
}, '0.1', {requires:['widget', 'selector-css3', 'widget-parent', 'widget-child']});
<!DOCTYPE html>
<html>
<head></head>
<body>
<form id="myform" name="myform">
<input type="radio" name="rad" value="foo" />
<input type="radio" name="rad" value="bar" />
</form>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.2.0/build/yui/yui-min.js"></script>
<script type="text/javascript">
<div> <!-- header container -->
<div> <!-- left -->
<!-- logo here -->
</div>
<div> <!-- right -->
<div>
<!-- social networks /search here -->
</div> <!-- right top -->
<div>
<!-- nav menu -->
class ComboLoaderApp(object):
"""ComboLoader WSGI App
Retrieves files from a filesystem or HTTP Request and concatenates them
into one file request
"""
def __init__(self, config):
self.config = parse_config_file(config)
self.js_regex = re.compile('^.+?\.js$', re.IGNORECASE)
"""Combo Loader WSGI App
Variable location combo loader to import javascript and css files.
It will loader Javascript files into one JS and CSS into another much like YUI PHP Loader:
http://developer.yahoo.com/yui/phploader/
TODO:
Build in caching beaker, sessions, and/or memcache.
import httplib2
import json
from webob import Response
import logging
import pprint
log = logging.getLogger(__name__)
pp = pprint.PrettyPrinter()
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 55653)
Traceback (most recent call last):
File "/Users/chrisgeo/projects/combodev/lib/python2.7/site-packages/paste/httpserver.py", line 1068, in process_request_in_thread
self.finish_request(request, client_address)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 639, in __init__
self.handle()
File "/Users/chrisgeo/projects/combodev/lib/python2.7/site-packages/paste/httpserver.py", line 442, in handle
<!DOCTYPE html>
<html>
<head></head>
<body>
<form id="myform" name="myform">
<input type="radio" name="rad" value="foo" />
<input type="radio" name="rad" value="bar" checked />
</form>
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.2.0/build/yui/yui-min.js"></script>
<script type="text/javascript">
//set global YUI conf here because we are now hosting the files.
YUI_config = {
combine: false,
base: "/js/yui/",
loadOptional: false,
//filter: 'debug',
groups: {
gallery: {
base: '/js/gallery/',
combine: false,
{%
import "foo/bar.html' as foo
foo.bar('foobar')
%}