Skip to content

Instantly share code, notes, and snippets.

View thouis's full-sized avatar

Thouis (Ray) Jones thouis

  • Broad Institute
  • Cambridge, MA, USA
View GitHub Profile
@thouis
thouis / gist:977370
Created May 17, 2011 20:52
idle time in python
# http://thp.io/2007/09/x11-idle-time-and-focused-window-in.html
# http://www.freedesktop.org/software/ConsoleKit/doc/ConsoleKit.html#Session:idle-hint
import Xlib.display
display = Xlib.display.Display()
focus = display.get_input_focus()
print "WM Class: %s" % ( focus.focus.get_wm_class(), )
print "WM Name: %s" % ( focus.focus.get_wm_name(), )
@thouis
thouis / attempt at gridding
Created April 5, 2011 15:02
gridding lines
for count, gene in countgenes:
name = wx.StaticText(self, -1, gene)
name.BackgroundColour = '#ffffff'
self.grid_sizer.Add(name, 0, wx.EXPAND)
c = wx.StaticText(self, -1, "%d"%(count))
self.grid_sizer.Add(c, 0, wx.EXPAND)
b1 = wx.RadioButton(self, -1, style=wx.RB_GROUP)
b1.BackgroundColour = '#ffffff'
b1.Alignment = wx.ALIGN_CENTER_HORIZONTAL
self.grid_sizer.Add(b1, flag=wx.ALIGN_CENTER|wx.EXPAND)