Skip to content

Instantly share code, notes, and snippets.

View quiver's full-sized avatar

George Yoshida quiver

View GitHub Profile
@quiver
quiver / client.py
Created September 16, 2012 10:54
Python port of half duplex FIFO program : http://developers.sun.com/solaris/articles/named_pipes.html
# Python port of half duplex FIFO program : http://developers.sun.com/solaris/articles/named_pipes.html
import sys
import config
def main():
if len(sys.argv) < 2:
print 'Usage : %s <string to be sent to the server>' % sys.argv[0]
sys.exit(0)
wr = open(config.HALF_DUPLEX, 'wb')
@quiver
quiver / inotify.py
Created September 3, 2012 15:10
Python implementation of "IBM DeveloperWorks : Monitor Linux file system events with inotify"
import collections
import ctypes
import ctypes.util
# bit masks
IN_ISDIR = 0x40000000
IN_ALL_EVENTS = 0xfff
class inotify_event_struct(ctypes.Structure):
"""
@quiver
quiver / stack_issue08.diff
Created September 7, 2011 09:58
Py-StackExchange issue#8
diff --git a/stackexchange/__init__.py b/stackexchange/__init__.py
index c257838..32e3fb7 100644
--- a/stackexchange/__init__.py
+++ b/stackexchange/__init__.py
@@ -542,7 +542,7 @@ through here."""
try:
if isinstance(ob, datetime.datetime):
return str(time.mktime(ob.timetuple()))
- elif isinstance(ob, str):
+ elif isinstance(ob, basestring):