Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# computer activity data collection for http://jehiah.cz/one-two/
# by Jehiah Czebotar
FILE="activity_log/`date +%Y%m%d`.log"
function log_activity()
{
local UTC=`date "+%s,%Z"`
local IDLE=$((`/usr/sbin/ioreg -c IOHIDSystem | sed -e '/HIDIdleTime/!{ d' -e 't' -e '}' -e 's/.* = //g' -e 'q'` / 1000000000 ))
@hyperturtle
hyperturtle / flask_geventwebsocket_example.py
Created February 16, 2012 20:44 — forked from lrvick/flask_geventwebsocket_example.py
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
from jinja2 import Environment, FileSystemLoader
from jinja2 import meta as jinjaMeta
from hyphenator import Hyphenator
hyphen = Hyphenator("eng.dic")
from os.path import join, dirname, abspath, normpath
import yaml
import markdown