Skip to content

Instantly share code, notes, and snippets.

@mitechie
mitechie / webtail.py
Created October 21, 2011 14:41 — forked from maximebf/webtail.py
Web tail / tail -f as a webpage using websocket
#!/usr/bin/python
# Equivalent of "tail -f" as a webpage using websocket
# Usage: webtail.py PORT FILENAME
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
import tornado.httpserver
# Yummy constants to use in the Application
class System(MyEnum):
"""Enum type for the Users System level access"""
_enum = {
'hotalert': 'HotAlert',
'dashboard': 'Dashboard',
'defect': 'Defect',
}
class Role(meta.Base):
from Queue import Queue
class ShowQueue(object):
"""We need to implement the basics of Queue to use it"""
def __init__(self):
self.queue_store = Queue()
def qsize(self):
return self.queue_store.qsize()
/**
* Pop the history stack and run the load function for the page
* requested
*
*/
that.backward = function() {
var new_page;
console.log('BACKWARD');
console.log(that.history);
console.log(that.history.length);
from fabric.api import env
# Globals
env.project_name = 'proj'
env.packagedir = 'http://packageserver.com/packages/'
env.new_version_files = ['setup.py',
'docs/source/conf.py',
]
from fabric.api import env
# Globals
env.project_name = 'proj'
env.packagedir = 'http://packageserver.com/packages/'
env.new_version_files = ['setup.py',
'docs/source/conf.py',
]
We won't rock the boat. We'll go with Detroit Midtown. We're hoping to attr=
act Wayne State students and activate the TechTown area.=20
Thanks guys.=20
David I Tobar
313 549 3785
Sent from my iPhone
On Jun 22, 2011, at 10:56 PM, Rick Harding <rharding@mitechie.com> wrote:
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
URL: http://bmark.us//admin/redirect/9eca26b9f078af
File '/home/bmark.us/rick/lib/python2.6/site-packages/weberror/errormiddleware.py', line 162 in __call__
app_iter = self.application(environ, sr_checker)
File '/home/bmark.us/rick/lib/python2.6/site-packages/repoze/tm/__init__.py', line 23 in __call__
result = self.application(environ, save_status_and_headers)
File '/home/bmark.us/rick/lib/python2.6/site-packages/pyramid/router.py', line 158 in __call__
silly testEngine { name: 'get',
silly testEngine description: 'A slightly higher-level HTTP client for node.',
silly testEngine version: '0.3.0',
silly testEngine main: './lib/node-get/index.js',
silly testEngine keywords: [ 'http', 'client', 'request', 'get' ],
silly testEngine url: 'http://github.com/tmcw/node-get',
silly testEngine repositories:
silly testEngine [ { type: 'git',
silly testEngine url: 'git://github.com/tmcw/node-get.git' } ],
silly testEngine author:
@mitechie
mitechie / s3cp.py
Created June 2, 2011 01:34
s3cp.py
#!/usr/bin/env python2
import argparse
import logging
import os
import sys
from boto.s3.connection import S3Connection
LOG_FILENAME = '/home/rharding/.s3cp.log'
NEVER = 'Thu, 31 Dec 2037 23:59:59 GMT'