This file contains hidden or 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/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: |
This file contains hidden or 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
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() |
This file contains hidden or 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 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> |
This file contains hidden or 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
Kod: | |
(...) | |
templates = local() | |
templates.loaded = {} | |
def load_builder(builder, template_path): | |
try: | |
builder.add_from_string(templates.loaded[template_path]) |
This file contains hidden or 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
GtkButton.nasz_button { background-image: url('sciezka_do_img'); } | |
GtkButton.nasz_button:hover { background-image: url('sciezka_do_innego_img'); } |
This file contains hidden or 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
(...) | |
class Character(Base): | |
__tablename__ = 'characters' | |
uid = Column(Integer, primary_key=True) | |
session = Column(Integer, ForeignKey('sessions.uid')) | |
created = Column(DateTime, default=datetime.datetime.utcnow) | |
name = Column(Unicode(255)) |
This file contains hidden or 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
Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/dist-packages/cx_Freeze/initscripts/Console.py", line 27, in <module> | |
exec code in m.__dict__ | |
File "taskworkshop-light.py", line 1, in <module> | |
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/gtk3reactor.py", line 22, in <module> | |
from twisted.internet import gireactor | |
File "/usr/local/lib/python2.7/dist-packages/twisted/internet/gireactor.py", line 33, in <module> | |
from gi.repository import GLib | |
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 27, in <module> | |
import gi._gobject |
This file contains hidden or 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
LOCK TABLE {table} IN ACCESS EXCLUSIVE MODE; | |
UPDATE {table} SET status = 1, thread_id = 1 | |
WHERE id IN ( | |
SELECT id FROM {table} WHERE status = 0 | |
ORDER BY creation_date DESC, user_id ASC | |
LIMIT 100) | |
RETURNING 'id', 'user_id', 'creation_date', 'modification_date', 'thread_id', 'reason', 'status'; | |
Or from statement log: |
This file contains hidden or 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
class AccountSerializer(serializers.ModelSerializer): | |
class Meta: | |
model = Account | |
fields = ('id', 'account_name', 'user_set', 'created') | |
depth = 1 |
This file contains hidden or 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
gphoto2 --wait-event-and-download --keep --force-overwrite --hook-script=/full/path/to/show_img.sh |
OlderNewer