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
$ cat packages.txt | |
minimock | |
formencode | |
sqlobject | |
tempita | |
initools | |
zptkit | |
pastewebkit | |
deliverance | |
httpencode |
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 onButtonClicked() { | |
console.log("yay, click!"); | |
} | |
document.getElementById("button").addEventListener("click", function () { | |
TogetherJS.send({type: "myButtonClick"}); | |
onButtonClicked(); | |
}, false); | |
TogetherJS.hub.on("myButtonClick", 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
import decorator | |
def multiplier(n): | |
def decorator(fn): | |
return Multiplier(fn, n) | |
return decorator | |
class Multiplier(object): | |
def __init__(self, func, n): | |
self.func = func |
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
Traceback (most recent call last): | |
File "/usr/local/share/silverlining/mgr-scripts/master-runner.py", line 44, in application | |
return found_app(environ, start_response) | |
File "/var/www/zamboni.2010-04-01_003/lib/python/django/core/handlers/wsgi.py", line 241, in __call__ | |
response = self.get_response(request) | |
File "/var/www/zamboni.2010-04-01_003/lib/python/django/core/handlers/base.py", line 143, in get_response | |
return self.handle_uncaught_exception(request, resolver, exc_info) | |
File "/var/www/zamboni.2010-04-01_003/lib/python/django/core/handlers/base.py", line 101, in get_response | |
response = callback(request, *callback_args, **callback_kwargs) | |
File "/var/www/zamboni.2010-04-01_003/src/zamboni-src/zamboni/apps/addons/views.py", line 225, in home |
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
## Descriptors | |
## Anything with __get__ and __set__: | |
class classinstancemethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, type=None): | |
def repl(*args, **kw): | |
return self.func(obj, type, *args, **kw) |
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
## Descriptors | |
## Anything with __get__ and optionally __set__: | |
class classinstancemethod(object): | |
def __init__(self, func): | |
self.func = func | |
def __get__(self, obj, type=None): | |
def repl(*args, **kw): | |
return self.func(obj, type, *args, **kw) |
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
<body> | |
<div id="header">stuff...</div> | |
<div id="body"> | |
</div> | |
<div id="templates" style="display: none"> | |
<div class="page-main"> | |
Template for the main page... | |
</div> | |
<div class="page-view"> | |
Template for the view page... |
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
templateDirectives = { | |
'page-main': { | |
... | |
}, | |
'page-view': { | |
... | |
} | |
}; | |
templates = {}; |
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 app = $.sammy(function () { | |
this.element_selector = '#body'; | |
this.get('#/', function (context) { | |
... stuff to do for the URL /#/ ... | |
}); | |
this.get('#/view/:id', function (context) { | |
... stuff for e.g., /#/view/10 ... | |
... use this.params.id to get "10" ... | |
}); | |
}); |
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
this.get('#/view/:id', function (context) { | |
$.ajax({ | |
url: './api/view/'+this.params.id, | |
dataType: 'json', | |
success: function (result) { | |
renderPage('page-view', result); | |
} | |
}); | |
}); |
OlderNewer