This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import logging | |
import dbus | |
import dbus.service | |
import gobject | |
# Set DBUS as the default MainLoop. | |
from dbus.mainloop.glib import DBusGMainLoop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import gtk, gobject, indicate, dbus, webkit | |
from xdg.DesktopEntry import DesktopEntry | |
from mako.template import Template | |
class IndicatorInspector: | |
def __init__(self): | |
self.servers = [] | |
self.listener = indicate.Listener() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2009 Igor Kolar <igor.kolar@gmail.com> | |
# | |
# Licensed under the EUPL, Version 1.1 or – as soon they | |
# will be approved by the European Commission - subsequent | |
# versions of the EUPL (the "Licence"); | |
# You may not use this work except in compliance with the | |
# Licence. | |
# You may obtain a copy of the Licence at: | |
# http://ec.europa.eu/idabc/eupl5 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#Copyright (C) 2009 Nikitas Stamatopoulos | |
# Modified by endolith@gmail.com 2009-10 | |
#This program is free software: you can redistribute it and/or modify | |
#it under the terms of the GNU General Public License as published by | |
#the Free Software Foundation, either version 3 of the License, or | |
#(at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import gtk, dbus, dbus.service, sqlite3 | |
from dbus.mainloop.glib import DBusGMainLoop | |
DB_FILENAME = "/home/segphault/test.sqlite" | |
DBusGMainLoop(set_as_default=True) | |
class Notifier(dbus.service.Object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import dbus, gobject, avahi, pynotify, time | |
from dbus import DBusException | |
from dbus.mainloop.glib import DBusGMainLoop | |
TYPE = '_workstation._tcp' | |
def service_resolved(*args): | |
name = args[5].split('.')[0] | |
ip = args[7] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Detect Full-Screen</title> | |
<style> | |
* { | |
font-family: sans-serif; | |
line-height: 1.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtualenv --no-site-packages . | |
source bin/activate | |
bin/pip install Django psycopg2 django-sentry | |
bin/pip freeze > requirements.txt | |
bin/django-admin.py startproject mysite | |
cat >.gitignore <<EOF | |
bin/ | |
include/ | |
lib/ | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""This is a demonstration of sharing file descriptors across processes. | |
It uses Tornado (need a recent post-2.0 version from github) and the | |
multiprocessing module (from python 2.6+). To run it, start one copy | |
of fdserver.py and one or more copies of testserver.py (in different | |
terminals, or backgrounded, etc). Fetch http://localhost:8000 and | |
you'll see the requests getting answered by different processes (it's | |
normal for several requests to go to the same process under light | |
load, but under heavier load it tends to even out). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
OlderNewer