Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View alfredfrancis's full-sized avatar
🎯
Focusing

Alfred Francis alfredfrancis

🎯
Focusing
View GitHub Profile
@adunkman
adunkman / index.html
Created January 14, 2012 15:28
Relay messages from RabbitMQ to a browser using Socket.io
<!DOCTYPE html>
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script>
(function () {
var onMessage = function (data) {
// Do something with the message data
};
@fnielsen
fnielsen / gist:1226214
Created September 19, 2011 09:32
Email classification example with Python, NLTK, ...
documents = [ dict(
email=open("conference/%d.txt" % n).read().strip(),
category='conference') for n in range(1,372) ]
documents.extend([ dict(
email=open("job/%d.txt" % n).read().strip(),
category='job') for n in range(1,275)])
documents.extend([ dict(
email=open("spam/%d.txt" % n).read().strip(),
category='spam') for n in range(1,799) ])