Skip to content

Instantly share code, notes, and snippets.

View KeyWeeUsr's full-sized avatar

Peter Badida KeyWeeUsr

View GitHub Profile
@KeyWeeUsr
KeyWeeUsr / known-problems.md
Created July 2, 2018 18:40 — forked from dolang/known-problems.md
Known Problems

Known Problems

  • Travis CI: Some problem with the Inspector can cause the tests # 121 test_widget_multipopup and # 122 test_widget_popup to hang on Travis CI and in VirtualBox VMs. Manual minimise/maximise/restore/resize fixes it. Current workaround in 55200ee.

  • Appveyor: MinGW tests fail due to lack of proper OpenGL support. Potential fix: see how

@KeyWeeUsr
KeyWeeUsr / kivy-kv-encoding.md
Created June 30, 2018 13:22 — forked from dolang/kivy-kv-encoding.md
[Draft] New Default Encoding for .kv Files: Pros / Cons

New Default Encoding for .kv Files: Pros / Cons

Note: This would be in addition to a directive like in Python files: coding: ...

UTF-8 Everywhere

  • (+) Simple, straight-forward
  • (-) Builder.load_file(...) and Builder.load_string(open(...)) would have differing behaviours (Windows, Linux without UTF-8 locale) because default open(...) uses preferred system encoding
  • (?) can't say what the impact on mobile devices is (Android/iOS)
I'm trying to layout a widget like this:
----------------------------
| [IMAGE] |
|[.....a label here.......]|
----------------------------
Where the image is centered at the top, and the label is centered at the bottom.
Here's some code:
-----------------------------
from kivy.app import App
#:kivy 1.8.0
<Root>:
orientation: "vertical"
Button:
text: "Start GTK thread" if not app.gtk_started else "Stop GTK thread"
on_release: app.start_gtk_thread()
@KeyWeeUsr
KeyWeeUsr / main.py server.py.py
Created February 26, 2018 20:06 — forked from anonymous/main.py server.py.py
main.py server.py
$ cat main.py
from kivy.app import App
from kivy.clock import Clock
from kivy.lib import osc
class Bomberman(App):
def build(self):
self.osc = osc.listen(ipAddr='', port=osc.init(ipAddr=''))
Clock.schedule_interval(self.update_osc, 0)
@KeyWeeUsr
KeyWeeUsr / log.txt
Created February 6, 2018 22:17 — forked from johannesmueller-fr/log.txt
Unpredictable behaviour in Vector.segment_intersection()
[INFO ] Logger: Record log in /home/waschtl/.kivy/logs/kivy_15-02-02_58.txt
[INFO ] Kivy v1.8.0
[INFO ] Factory: 157 symbols loaded
[DEBUG ] Cache: register <kv.lang> with limit=None, timeout=Nones
[DEBUG ] Cache: register <kv.image> with limit=None, timeout=60s
[DEBUG ] Cache: register <kv.atlas> with limit=None, timeout=Nones
[INFO ] Image: Providers: img_tex, img_dds, img_pygame, img_pil, img_gif
[DEBUG ] Cache: register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] Cache: register <kv.shader> with limit=1000, timeout=3600s
[DEBUG ] App: Loading kv <./test.kv>
from jnius import find_javaclass
froj jnius.reflect import get_signature
c = find_javaclass('android.bluetooth.BluetoothDevice')
methods = c.getMethods()
for m in methods:
if m.getName == 'connectGatt':
print(get_signature(m))
'''This is a simple example of how to use suggestion text.
In this example you setup a word_list at the begining. In this case
'the the quick brown fox jumps over the lazy old dog'. This list along
with any new word written word in the textinput is available as a
suggestion when you are typing. You can press tab to auto complete the text.
'''
import sys
from kivy.clock import Clock
from kivy.app import App
from kivy.uix.textinput import TextInput
@KeyWeeUsr
KeyWeeUsr / clfontpng.cc
Created December 9, 2016 13:35 — forked from jokertarot/clfontpng.cc
How to render color emoji font with FreeType 2.5
// = Requirements: freetype 2.5, libpng, libicu, libz, libzip2
// = How to compile:
// % export CXXFLAGS=`pkg-config --cflags freetype2 libpng`
// % export LDFLAGS=`pkg-config --libs freetype2 libpng`
// % clang++ -o clfontpng -static $(CXXFLAGS) clfontpng.cc $(LDFLAGS) \
// -licuuc -lz -lbz2
#include <cassert>
#include <cctype>
#include <iostream>
#include <memory>
@KeyWeeUsr
KeyWeeUsr / .spacemacs
Created September 28, 2016 19:55 — forked from cruor99/.spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory