Skip to content

Instantly share code, notes, and snippets.

View dolang's full-sized avatar

dolang

View GitHub Profile
@dolang
dolang / kivy-ppa-daily-test.yml
Last active May 18, 2018 17:45
Install Kivy from the daily PPA; download & run the tests. Ansible playbook.
---
# Ansible Playbook for Ubuntu which installs the Kivy daily PPA
# packages, then fetches and runs the tests.
#
# The PPA is: `ppa:kivy-team/kivy-daily`. The script creates a shallow
# Kivy clone into ~/kivy, so make sure that directory is either already
# a Kivy repository or nonexistant/empty.
#
# Test output is saved separately for py2/py3 as `~/py2-kivy-tests.log`
# and `~/py3-kivy-tests.log`. They contain raw characters, so open
@dolang
dolang / kivy-dev-fedora.yml
Created May 19, 2018 01:40
Fedora Kivy dev Ansible playbook (draft)
---
# Kivy development installation into a virtualenv from the master branch
# of the GitHub repository. Meant to be run locally for the currently
# logged in user.
# Fedora, Python 3, Cython 0.28.2, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
@dolang
dolang / kivy-dev-opensuse.yml
Created May 20, 2018 08:02
openSUSE Kivy dev Ansible playbook (draft)
---
# Kivy development installation into a virtualenv from the GitHub master
# repository. Meant to be run locally for the currently logged in user.
# openSUSE, Python 3, Cython 0.28.2, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
# : └── ...
@dolang
dolang / kivy_asyncio_example.py
Created May 28, 2018 15:46
Kivy with an asyncio EventLoop example
"""
Kivy asyncio example app.
Kivy needs to run on the main thread and its graphical instructions have to be
called from there. But it's still possible to run an asyncio EventLoop, it
just has to happen on its own, separate thread.
Requires Python 3.5+.
"""
@dolang
dolang / kivy-dev-manjaro.yml
Created June 24, 2018 01:37
Manjaro Kivy dev Ansible playbook (draft)
---
# Kivy development installation into a virtualenv from the GitHub master
# repository. Meant to be run locally for the currently logged in user.
# Manjaro, Python 3, Cython 0.28.3, HEAD of master branch.
#
# ~/
# ├── kivy (kivy_local_repo)
# │ └── ...
# ├── venv (venv)
# : └── ...
@dolang
dolang / coding_test.pyx
Last active July 6, 2018 12:19
Cython oddity
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from libc.stdint cimport uint8_t # note: it's *cimport* not *import*
from random import randint
cpdef char* random_chars(int length=100):
cdef:
char[100] r_chars
uint8_t a_char