Skip to content

Instantly share code, notes, and snippets.

View niktto's full-sized avatar

Marek Szwałkiewicz niktto

View GitHub Profile
@niktto
niktto / issue_sample.py
Created August 19, 2012 20:12
Issue with default Unity styling
from gi.repository import Gtk
builder = Gtk.Builder()
builder.add_from_string(
"""
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
<child>
@niktto
niktto / notify.py
Created June 23, 2012 18:23
Sample notification
In [1]: import pynotify
In [2]: pynotify.init("Sample Application Title")
Out[2]: True
In [3]: n = pynotify.Notification("Title", "Message")
In [4]: n.add_action("buttonid", "Happy Button :)", lambda x: x)
In [5]: n.show()
@niktto
niktto / qnapi_fix.py
Created May 1, 2012 22:00
Simple script to fix QNapi subtitles
#!/usr/bin/python3
import codecs
import sys
try:
inp = codecs.open(sys.argv[1],'r','cp1250')
except IndexError:
print('You need to give me text file with qnapi subtitles as an argument. Thanks.')
else: