This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you run into the the following error while installing pygraphviz into a virtualenv | |
# (on macOs, python3) | |
# | |
# pygraphviz/graphviz_wrap.c:2987:10: fatal error: 'graphviz/cgraph.h' file not found | |
# #include "graphviz/cgraph.h" | |
# ^~~~~~~~~~~~~~~~~~~ | |
# 1 error generated. | |
# error: command 'clang' failed with exit status 1 | |
# - Install graphviz via brew |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
# Usage: | |
# build.sh kivy-app.sh | |
# | |
# What does this?: | |
# This signs kivy executables built with pyinstaller for macOS. | |
# | |
#### | |
if [ $# -eq 0 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def validateEmail(self, email): | |
"""This function validates the mail address given | |
in the argument: email. | |
""" | |
if len(email) > 7: | |
if re.match("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", email) != None: | |
return True | |
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you get an error like | |
# ('SSL routines', 'ssl3_get_server_certificate', 'certificate verify failed') | |
# when using twisted, autobahn, etc... | |
# on osx | |
# than you may have to update your openssl | |
# Do this by using brew: | |
# (install brew) | |
brew update | |
brew install openssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copied from https://gist.github.com/DenJohX/e6d0864738da10cb9685 -> DenJohX | |
# Slightly modified | |
import sys | |
from twisted.python import log | |
from twisted.internet import reactor | |
from twisted.internet.protocol import ReconnectingClientFactory | |
from autobahn.websocket.protocol import parseWsUrl | |
from autobahn.twisted import wamp, websocket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from OSC import OSCServer | |
from OSC import OSCClient | |
from OSC import OSCMessage | |
import time | |
import Queue | |
import threading | |
server = OSCServer(("localhost", 3333)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kivy.config import Config | |
Config.set('graphics', 'width', '700') | |
Config.set('graphics', 'height', '200') | |
Config.write() | |
from kivy.app import App | |
from kivy.uix.floatlayout import FloatLayout | |
from kivy.lang import Builder | |
from kivy.properties import BooleanProperty, StringProperty | |
from kivy.clock import Clock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace 'venv' with the foldername of your virtualenv. | |
# This script links the gst module and it's dependecies into the virtualenv. | |
# Tested on ubuntu 12.04 | |
sudo apt-get install python-gst0.10 | |
cd venv/lib/python2.7/site-packages | |
ln -s /usr/lib/python2.7/dist-packages/glib | |
ln -s /usr/lib/python2.7/dist-packages/gobject | |
ln -s /usr/lib/python2.7/dist-packages/gst-0.10 | |
ln -s /usr/lib/python2.7/dist-packages/gstoption.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspired by: | |
# - https://gist.github.com/goldsmith/7262122 | |
# - https://gist.github.com/brousch/6589386 | |
#### Some hints #### | |
# Currently kivy apps only work on monitor 1 (multiple monitor setup) | |
# You have to place the terminal which runs kivy on the monitor 1 or make the app fullscreen. | |
# Make sure you have the "command line tools" for mavericks installed! | |
# (xcode-select --install) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_touch_down(self, touch, *kwargs): | |
if not self.collide_point(*touch.pos): | |
return | |
touch.grab(self) | |
self.touches.append(touch) | |
touch.is_dragging = False | |
touch.is_scrolling = False | |
if len(self.touches)==1: |
NewerOlder