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 flask.ext.socketio import SocketIO, emit | |
# flask app configuration, other flask stuff in between. other stuff cut out for brevity | |
@socketio.on('my broadcast event', namespace='/live') | |
def live_message(): | |
emit('my response', {'data': statuscontent()}, broadcast=True) | |
print(request.namespace, 'broadcast socketio') | |
@socketio.on('connect', namespace='/live') |
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
[excluded] | |
tables = ProjectInfo, AddressTypes, AddressTypes_tracking, ClientAddresses_tracking, ClientContacts, ClientContacts_tracking, ClientTypes, ClientAddresses, Clients, Clients_tracking, ContactGroups, ContactGroups_tracking, Contacts, Contacts_tracking |
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
<PropertyTag>: | |
size_hint: (None, None) | |
size: tag_label.size | |
Label: | |
size: self.texture_size | |
on_touch_down: print(self.on_touch_down) | |
on_touch_up: print(self.on_touch_up) | |
id: tag_label | |
color: 0, 0, 0, 1 | |
canvas.before: |
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
StackLayout: | |
PinchLabel: | |
text: 'hello' |
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 functools import wraps | |
def memoized(f): | |
"""Decorator that caches a function's return value each time it is | |
called. If called later with the same arguments, the cached value | |
is returned, and not re-evaluated. | |
""" | |
cache = {} | |
@wraps(f) |
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
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause" XF86AudioPlay | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop" XF86AudioStop | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next" XF86AudioNext | |
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous" XF86AudioPrevious |
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
#!/usr/bin/python3 | |
from kivy.app import App | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.uix.button import Button | |
class AfterSuperButton(Button): | |
def __init__(self, **kwargs): |
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
#!/usr/bin/env python | |
from pyzmo import * | |
from evdev.ecodes import * | |
from evdev import InputDevice | |
import socket | |
TCP_IP = '127.0.0.1' | |
TCP_PORT = 8000 | |
import serial |
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
import fnmatch | |
import os, sys | |
#import pyperclip # for clipboard usage | |
import webbrowser | |
for file in os.listdir('.'): | |
if fnmatch.fnmatch(file, '*'+sys.argv[1]+'*'): | |
print "File: " + file | |
choice = raw_input("Delete? Y/N/L") | |
if choice.upper() == 'L': |
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 collections import defaultdict | |
import tmx | |
from cymunk.cymunk import Vec2d | |
from kivent_maps.map_utils import _load_obj_models, _load_tile_map, _load_tile_properties | |
from kivent_maps.map_utils import _load_tilesets | |
from kivy.app import App, platform | |
from kivy.core.window import Window, Keyboard | |
from kivy.clock import Clock | |
from kivy.uix.widget import Widget |
OlderNewer