( 淡入 一群身著制服,表情嚴肅的軍官。)
會議桌的主位上,一位資深高階 將軍 正在說話。
將軍:報告已經證實了,紐約市已經…被殭屍占領了。
上校:又來了?明明 28 天前才發生過一次殭屍入侵!
將軍:這些僵屍…不一樣。它們是… 哲學 僵屍。
| # %(mysite)s - run %(mysite)s instances (default is the main production instance) | |
| # | |
| # This runs gunicorn-django for %(mysite)s; to install: | |
| # * sudo ln -s <this file> /etc/init/%(mysite)s | |
| # * sudo initctl reload-configuration | |
| # | |
| # it expects the following directory layout: | |
| # | |
| # /home/%(mysite)s/public_html | |
| # \-env -> virtualenv |
| """ | |
| Copyright (c) 2012 Zohaib Sibte Hassan | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR |
| from tempfile import NamedTemporaryFile | |
| def tempfile_path(): | |
| with NamedTemporaryFile(delete=False) as f: | |
| return f.name | |
| def main(): | |
| print tempfile_path() | |
| if __name__ == '__main__': |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Title</title> | |
| </head> | |
| <body> | |
| <form method="post"> | |
| {{ form.hidden_tag() }} | |
| {{ form.example }} |
| setattr(DictLike, attrname, | |
| # it is a colsure | |
| (lambda x: | |
| property( | |
| lambda self: self.__getitem__(x), | |
| lambda self, v: self.__setitem__(x, v), | |
| lambda self: self.__delitem__(x) | |
| ) | |
| )(attrname) | |
| ) |
| # dont do this | |
| this_function_name(foo, bar | |
| baz) | |
| # do this | |
| cramers_version( | |
| foo, bar, baz) | |
| # allow this | |
| cramers_version(foo, bar, |
| from wsgiref.simple_server import make_server | |
| from pyramid.config import Configurator | |
| from pyramid.response import Response | |
| from pyramid.compat import text_type | |
| from sqlalchemy.orm import scoped_session | |
| from sqlalchemy.orm import sessionmaker | |
| from sqlalchemy import create_engine | |
| from sqlalchemy.ext.declarative import declarative_base |
( 淡入 一群身著制服,表情嚴肅的軍官。)
會議桌的主位上,一位資深高階 將軍 正在說話。
將軍:報告已經證實了,紐約市已經…被殭屍占領了。
上校:又來了?明明 28 天前才發生過一次殭屍入侵!
將軍:這些僵屍…不一樣。它們是… 哲學 僵屍。
TodoMVC in Om + Sablono + core.async (well, core.async not so much in the end)
This is a result of a three-ish hours long try to understand Om better on a TodoMVC example. Next steps would be finishing implementing rest of the functionality as dictated by the app specification, and then refactoring. And then some more refactoring. And then ...
I recorded a screencast of this: http://youtu.be/7j133D79Vaw
JSON