Skip to content

Instantly share code, notes, and snippets.

@kived
kived / uni.txt
Created August 20, 2014 19:28
unicode stuff
lkjaôlsfka ôdlf kajsd flskdf jaôslfd kaj+ ľščť ýáí= éíáä úň§ô-.,
כל הצלילים, התמונות והגופנים ב-childsplay ובמשחקים
@kived
kived / popref.py
Created August 20, 2014 20:46
popup widget ref
class SaveDialog(Popup):
def open(self, textinput):
self.textinput = textinput
super(SaveDialog, self).open()
def save_man_2(self):
path = str(''.join(self.ids.filechooser.selection))
path = path.replace('/','')
path = path.replace('\\','/')
rootpath = os.path.dirname(os.path.abspath(__file__))
@kived
kived / uni.py
Created August 23, 2014 19:05
unicode cython test
# -*- coding: utf-8 -*-
def testfn():
print [unicode('%s') % (u'C:\\FFmpeg\\๗in.jpeg', )]
return [unicode('%s') % (u'C:\\FFmpeg\\๗in.jpeg', )]
if __name__ == '__main__':
from unicy import main
main()
@kived
kived / select.py
Created August 25, 2014 16:37
setattr stuff
class Selector(object):
__slots__ = ('...',)
def __setattr__(self, name, value):
try:
return object.__setattr__(self, name, value)
except AttributeError:
for widget in self:
self._set_widget_attr(widget, name, value)
@kived
kived / testattr.py
Created August 25, 2014 22:08
test attribute setting
from timeit import timeit
class TestAttr(object):
def __init__(self):
self.a = 1
def hasset(self, name, value):
if hasattr(self, name):
setattr(self, name, value)
@kived
kived / hasattrgets.py
Created August 25, 2014 22:18
hasattr calls getattr (sometimes)
from time import sleep
from timeit import timeit
class TestHasattr(object):
def __init__(self):
self.a = 1
def __getattr__(self, name):
print 'sleeping...'
sleep(0.1)
@kived
kived / rtltest.py
Created August 30, 2014 23:37
kivy rtltest
# -*- coding: utf-8 -*-
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
root = Builder.load_string('''
<RTLTest@BoxLayout>:
@kived
kived / output.txt
Created September 3, 2014 21:34
gst debug output
0:00:00.000124579 26334 0x1b0aa00 INFO GST_INIT gst.c:502:init_pre: Initializing GStreamer Core Library version 1.2.4
0:00:00.000269073 26334 0x1b0aa00 INFO GST_INIT gst.c:503:init_pre: Using library installed in /usr/lib/x86_64-linux-gnu
0:00:00.000342159 26334 0x1b0aa00 INFO GST_INIT gst.c:513:init_pre: Linux ryan-lappy 3.13.0-35-lowlatency #62-Ubuntu SMP PREEMPT Fri Aug 15 02:26:48 UTC 2014 x86_64
0:00:00.002408655 26334 0x1b0aa00 INFO GST_INIT gstmessage.c:123:_priv_gst_message_initialize: init messages
0:00:00.002708527 26334 0x1b0aa00 INFO GST_INIT gstcontext.c:77:_priv_gst_context_initialize: init contexts
0:00:00.003271691 26334 0x1b0aa00 INFO GST_PLUGIN_LOADING gstplugin.c:317:_priv_gst_plugin_initialize: registering 0 static plugins
0:00:00.003658206 26334 0x1b0aa00 INFO GST_PLUGIN_LOADING gstplugin.c:225:gst_plugin_register_static: registered static plugin "staticelements"
0:00:00
@kived
kived / dynamic.kv
Last active August 29, 2015 14:06
dynamic class
<MyWidget@BoxLayout>:
orientation: 'vertical'
my_button: btn
Label:
text: 'my text'
Button:
id: btn
text: 'OK'
@kived
kived / giftest.py
Created September 5, 2014 16:39
kivy gif test
import kivy
kivy.require('1.8.1')
from kivy.app import App
from kivy.lang import Builder
root = Builder.load_string('''
Image:
#source: 'Newtons_cradle_animation_book_2.gif'
source: 'flies2.gif'