Skip to content

Instantly share code, notes, and snippets.

View rnixx's full-sized avatar
💭
building things

Robert Niederreiter rnixx

💭
building things
  • Innsbruck, Austria
View GitHub Profile
@rnixx
rnixx / gist:c60a744576866a7f1a42
Last active August 29, 2015 14:23
Kivy: Screen orientation change on Android at runtime
from android.runnable import run_on_ui_thread
from jnius import autoclass
from kivy.app import App
AndroidActivityInfo = autoclass('android.content.pm.ActivityInfo')
AndroidPythonActivity = autoclass('org.renpy.android.PythonActivity')
class MyApp(App):
@rnixx
rnixx / gist:f1c94490e636a4ed54b4
Last active May 2, 2016 20:14
Kivy: Material design ripple behavior mixin, based on TouchRippleBehavior from FlatKivy
from kivy.animation import Animation
from kivy.graphics import CanvasBase
from kivy.graphics import Color
from kivy.graphics import Ellipse
from kivy.graphics import ScissorPush
from kivy.graphics import ScissorPop
from kivy.properties import ListProperty
from kivy.properties import NumericProperty
from kivy.uix.relativelayout import RelativeLayout
@rnixx
rnixx / gist:491bf758918e3a1e13e9
Created March 12, 2015 14:35
Python: function debug decorator
def debug(func):
def wrapped(*args, **kwargs):
name = '{0}.{1}'.format(
func.__module__,
func.func_name
)
if args:
inst = args[0]
inst_func = getattr(inst, func.func_name, None)
unwrapped_func = getattr(inst_func, '_original_func', None)
@rnixx
rnixx / gist:add38d808b5a8ad73947
Last active September 2, 2020 13:21
Kivy App - Sticky hiding of navigation on Android
from kivy.app import App
from kivy.logger import Logger
try:
from jnius import autoclass
from android.runnable import run_on_ui_thread
android_api_version = autoclass('android.os.Build$VERSION')
AndroidView = autoclass('android.view.View')
AndroidPythonActivity = autoclass('org.renpy.android.PythonActivity')
@rnixx
rnixx / gist:6027502
Created July 18, 2013 07:47
patch for plone.app.async providing REQUEST on context
"""plone.app.async patch to provide old school Zope2 REQUEST on context.
Contributions:
* Jean Jordaan
* Robert Niederreiter
"""
import Zope2
import sys
from AccessControl.SecurityManagement import (