A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
| # This demo is a transliteration of the below referenced demo to use the async/await syntax | |
| # | |
| #https://www.reddit.com/r/Python/comments/33ecpl/neat_discovery_how_to_combine_asyncio_and_tkinter/ | |
| # | |
| # For testing purposes you may use the following command to create a test daemon: | |
| # tail -f /var/log/messages | nc -l 5900 | |
| # Enter localhost:5900 in the entry box to connect to it. | |
| from tkinter import * |
| """ | |
| Model of a Zombie outbreak in France, starting in Grenoble | |
| This is a rewrite from this blog post by Max Berrgren: | |
| http://maxberggren.github.io/2014/11/27/model-of-a-zombie-outbreak/ | |
| with a different country, a slightly different model, and different | |
| libraries. The map of population density is taken from Wikimedia Commons |
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
| [MASTER] | |
| # Specify a configuration file. | |
| #rcfile= | |
| # Python code to execute, usually for sys.path manipulation such as | |
| # pygtk.require(). | |
| #init-hook= | |
| # Profiled execution. |
| # -*- coding: utf-8 -*- | |
| from gevent import monkey; monkey.patch_all() | |
| import gevent | |
| from gevent_zeromq import zmq | |
| class WebSocketHandler(object): | |
| def __init__(self, _id, in_queue, socket): |
| # -*- coding: utf-8 -*- | |
| from django import forms | |
| from crispy_forms.helper import FormHelper | |
| from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field | |
| from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions | |
| class MessageForm(forms.Form): | |
| text_input = forms.CharField() |