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 / zope.tac
Created February 10, 2023 10:16
Run Zope with Twisted WSGI server utilizing asyncio main loop
# Rationale:
#
# - Zope nowadays runs behind WSGI
# - Modern (web) applications might want to serve websockets
# - Tools utilizing asyncio are a common thing and some might want to use them
# - Having twisted and/or asyncio opens a new universe of computing next to serving a web application inside one process
#
# Discussion:
#
# - Any discussion about why to use twisted is pointless.
@rnixx
rnixx / volto-sandbox.rst
Last active February 10, 2023 10:32
Create and install an environment for volto development on a linux machine (debian based)

How to bootstrap a volto project

Install Node package manager (npm). It is the tool required to install JavaScript packages and libraries:

sudo apt install npm

Install Node version manager (nvm). Volto frontend requires a Node.js server for resource delivery and server side rendering. Node version manager is a tool which helps running the version of Node.js required by Volto:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
--- video_ffpyplayer.py 2021-04-07 11:27:07.000952871 +0200
+++ video.py 2021-04-07 11:27:09.336960012 +0200
@@ -58,6 +58,7 @@
from kivy.clock import Clock, mainthread
from kivy.logger import Logger
from kivy.core.video import VideoBase
+from kivy.core.window import Window
from kivy.graphics import Rectangle, BindTexture
from kivy.graphics.texture import Texture
from kivy.graphics.fbo import Fbo
@rnixx
rnixx / l2tpclient.sh
Created July 12, 2019 06:04 — forked from danielv99/l2tpclient.sh
L2TP VPN client on Linux Debian
# Requirements
# debian/ubuntu
apt-get -y update && apt-get -y upgrade
apt-get -y install strongswan xl2tpd libstrongswan-standard-plugins libstrongswan-extra-plugins
VPN_SERVER_IP=''
VPN_IPSEC_PSK='y'
VPN_USER=''
VPN_PASSWORD=''
@rnixx
rnixx / README.rst
Last active March 25, 2019 13:42
Lightweight zope.testrunner integration on package level for layered tests

Lightweight zope.testrunner integration on package level for layered tests

Usage:

python setup.py test

or:

python -m mypackage.tests
@rnixx
rnixx / kv lang extensions proposal
Last active November 20, 2017 17:51
logical program structure extensions proposal for kivy language
# proposal for kivy language extensions
BoxLayout:
############
# conditions
if root.foo:
Label:
text: 'Condition true'
@rnixx
rnixx / gist:1f26328044b6e8996c6e
Last active August 29, 2015 14:23
Kivy: Widget Covering MJPEG Video based on https://gist.github.com/tito/d6eb474543c32eb33504
import io
import urllib
import threading
from kivy.uix.image import Image
from kivy.properties import StringProperty
from kivy.core.image import Image as CoreImage
from kivy.clock import Clock
from coverbehavior import CoverBehavior
@rnixx
rnixx / gist:794837ac5a29bc8dee4b
Last active August 29, 2015 14:23
Kivy: CoverBehavior - cover image or video to widget size
from decimal import Decimal
from kivy.lang import Builder
from kivy.properties import ListProperty
Builder.load_string("""
<-CoverBehavior>:
canvas.before:
StencilPush
Rectangle:
@rnixx
rnixx / gist:2aab5e13e17c1582b6dd
Created June 15, 2015 08:43
Kivy: Extended Screen manager with better convenience for switching between screens.
from kivy.uix.screenmanager import ScreenManager
from kivy.uix.screenmanager import ScreenManagerException
from kivy.uix.screenmanager import Screen
class ExtScreenManager(ScreenManager):
def __init__(self, **kwargs):
Logger.debug('ExtScreenManager.__init__')
self.register_event_type('on_finish_screen_switch')
@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):