An extremely minimal implementation of the `Finger protocol`_ using node.js.
To run (Finger uses port 79 which requires sudo):
sudo node finger_server.js
An extremely minimal implementation of the `Finger protocol`_ using node.js.
To run (Finger uses port 79 which requires sudo):
sudo node finger_server.js
from flask import Flask, request | |
from gevent.event import AsyncResult | |
from gevent.wsgi import WSGIServer | |
app = Flask(__name__) | |
waiters = [] | |
@app.route("/") | |
def main(): |
diff --git a/example/server.js b/example/server.js | |
index 167fc43..db758a2 100644 | |
--- a/example/server.js | |
+++ b/example/server.js | |
@@ -61,4 +61,16 @@ io.on('connection', function(client){ | |
client.on('disconnect', function(){ | |
client.broadcast({ announcement: client.sessionId + ' disconnected' }); | |
}); | |
-}); | |
\ No newline at end of file |
import logging | |
import os | |
import signal | |
import sys | |
def when_ready(server): | |
def monitor(): | |
modify_times = {} | |
while True: | |
for module in sys.modules.values(): |
""" | |
jQuery templates use constructs like: | |
{{if condition}} print something{{/if}} | |
This, of course, completely screws up Django templates, | |
because Django thinks {{ and }} mean something. | |
Wrap {% verbatim %} and {% endverbatim %} around those | |
blocks of jQuery templates and this will try its best |
import gevent | |
from gevent import socket, queue | |
from gevent.ssl import wrap_socket | |
import logging | |
logger = logging.getLogger('irc') | |
logger.setLevel(logging.DEBUG) | |
ch = logging.StreamHandler() |
from struct import unpack | |
import Image | |
tag_types = { 0 : 'End', | |
1 : 'Byte', | |
2 : 'Short', | |
3 : 'Int', | |
4 : 'Long', | |
5 : 'Float', | |
6 : 'Double', |
def elem2dict(node): | |
""" | |
Convert an lxml.etree node tree into a dict. | |
""" | |
d = {} | |
for e in node.iterchildren(): | |
key = e.tag.split('}')[1] if '}' in e.tag else e.tag | |
value = e.text if e.text else elem2dict(e) | |
d[key] = value | |
return d |
var net = require('net'); | |
var END = '\r\n'; | |
var groups = ['nodejs.test']; | |
var articles = { | |
'<[email protected]>' : {body : 'An article.'}, | |
'<[email protected]>' : {body : 'Another article.'}, | |
}; |