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
RACES = [ | |
'Dragonborn', | |
'Dwarf', | |
'Elf', | |
'Gnome', | |
'Half-Elf', | |
'Halfling', | |
'Half-Orc', | |
'Human', | |
'Tiefling', |
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 django.db import models | |
class SomeModel(models.Model): | |
email = models.EmailField() | |
first_name = models.CharField(max_length=50) | |
last_name = models.CharField(max_length=50) |
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
#!/bin/bash | |
if [ $ARGUMENT ]; then | |
if [[ $ARGUMENT =~ .+\.[jpg|JPG] ]] | |
then | |
killall eog | |
eog "$ARGUMENT" -f & | |
fi | |
fi |
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 |
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
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
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
(...) | |
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
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
Kod: | |
(...) | |
templates = local() | |
templates.loaded = {} | |
def load_builder(builder, template_path): | |
try: | |
builder.add_from_string(templates.loaded[template_path]) |
NewerOlder