-
Add
Enable=Source
to /etc/bluetooth/audio.conf right after[General]
. -
Find address in form XX:XX:XX:XX:XX:XX of phone with
hcitool scan
. -
Pair and trust smartphone with
sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX
andsudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes
. -
Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:
This file contains hidden or 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
var uuid = require("node-uuid"); | |
// Create a message to be consumed by the queuedemo.tasks.add Celery task | |
// will incorporate arguments x & y as part of `add(x,y)` message | |
function makeCeleryAddMessage(x, y){ | |
var msgId = uuid.v4(); | |
// This is the outer AMQP envelope | |
var msgEnvelope = { |
This file contains hidden or 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
P4A_pyjnius_DIR=~/code/pyjnius ./distribute.sh -b minimal -m 'pyjnius python' -u pyjnius | |
cd .; ./build.py --package org.minimal.test --name _MINIMAL --version 1 --private ~/code/testmininal --asset debug installd | |
adb logcat *:S python:D | |
This file contains hidden or 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
''' | |
Bluetooth/Pyjnius example | |
========================= | |
This was used to send some bytes to an arduino via bluetooth. | |
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't | |
tested without BLUETOOTH_ADMIN, maybe it works.) | |
Connect your device to your phone, via the bluetooth menu. After the | |
pairing is done, you'll be able to use it in the app. |
This file contains hidden or 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
''' | |
Use with Kivy Remote Shell: | |
cat test.py | ssh -p8000 -t -t [email protected] | |
''' | |
from jnius import autoclass, cast | |
from android.runnable import Runnable | |
activity = autoclass('org.renpy.android.PythonActivity').mActivity |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
from django.conf.urls import include | |
def decorated_include(urls, decorator) | |
"""Used to decorate all urls in a 3rd party app with a specific decorator""" | |
urls_to_decorate = include(urls) | |
for url_pattern in urls_to_decorate | |
url_pattern._callback = decorator(url_pattern._callback) |
This file contains hidden or 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 httplib | |
import urllib2 | |
import ssl | |
import certifi | |
from backports.ssl_match_hostname import match_hostname | |
class CertValidatingHTTPSConnection(httplib.HTTPConnection): | |
default_port = httplib.HTTPS_PORT |
This file contains hidden or 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 redis | |
import threading | |
class Listener(threading.Thread): | |
def __init__(self, r, channels): | |
threading.Thread.__init__(self) | |
self.redis = r | |
self.pubsub = self.redis.pubsub() | |
self.pubsub.subscribe(channels) | |
This file contains hidden or 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 os | |
import sys | |
import traceback | |
from functools import wraps | |
from multiprocessing import Process, Queue | |
def processify(func): | |
'''Decorator to run a function as a process. | |
Be sure that every argument and the return value |
This file contains hidden or 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
#!/bin/bash | |
# Usage: ko [options] FILE | |
# @author Weston Ruter (@westonruter) | |
# Komodo Edit or Komodo IDE? | |
if [ -e "/Applications/Komodo Edit.app" ]; then | |
app="Komodo Edit" | |
else | |
app="Komodo IDE" | |
fi |