- MQTT Essentials Part 1: Introducing MQTT
- MQTT Essentials Part 2: Publish & Subscribe
- MQTT Essentials Part 3: Client, Broker and Connection Establishment
- MQTT Essentials Part 4: MQTT Publish, Subscribe & Unsubscribe
- MQTT Essentials Part 5: MQTT Topics & Best Practices
- MQTT Essentials Part 6: Quality of Service Levels
- MQTT Essentials Part 7: Persistent Session and Queuing Messages
- [MQTT Essentials Part 8:
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
/** | |
* Wait for serial connection, with timeout | |
* @param timeout_milis The maximum time to wait for serial port, in milliseconds | |
* | |
* usage: | |
* | |
* void setup() { | |
* Serial.begin(9600); | |
* // Wait up to 3 seconds for serial connection | |
* waitForSerial(3000); |
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
; | |
; The GIMP -- an image manipulation program | |
; Copyright (C) 1995 Spencer Kimball and Peter Mattis | |
; | |
; Copy Visible & Paste as Layer script for GIMP 2.4 | |
; Created by Art Wade | |
; | |
; Tags: tool | |
; | |
; Author statement: |
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
def set_up_dag_run(context, dag_run_obj): | |
dag_run_obj.payload = {"config": context["config"]} | |
dag_run_obj.run_id = str(uuid4()) | |
print context | |
return dag_run_obj | |
def launch_workflow_command(args): | |
config_location = args.config_location | |
analysis_id = args.analysis_id |
Here's my list of interesting technical talks from PyCon 2016... stashed here for a future deep dive.
TODO: Categorize
- Mike Graham - The Life Cycle of a Python Class // Speaker Deck
- If you're defining
__new__
, write a function instead of a class. (Slide 18)
- If you're defining
- Flask for Fun and Profit // Speaker Deck
Installing PhantomJS 2.x on Ubuntu is done manually at present. Here's a recipe I like.
- Download PhantomJS latest stable http://phantomjs.org/download.html
- Extract tarball contents into
/usr/local/share
- In this example, latest tarball is named
phantomjs-2.1.1-linux-x86_64.tar.bz2
and will extract to/usr/local/share/phantomjs-2.1.1-linux-x86_64
PHANTOM_JS_FILES=/usr/local/share/phantomjs-2.1.1-linux-x86_64
sudo ln -s ${PHANTOM_JS_FILES}/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s ${PHANTOM_JS_FILES}/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s ${PHANTOM_JS_FILES}/bin/phantomjs /usr/bin/phantomjs
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
""" | |
Convert a CFFI cdata structure to Python dict. | |
Based on http://stackoverflow.com/q/20444546/1309774 with conversion of | |
char[] to Python str. | |
Usage example: | |
>>> from cffi import FFI | |
>>> ffi = FFI() |
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 | |
def is_heroku(): | |
"""Hack to return true if we're running inside a Heroku container. | |
Tested on Cedar stack. | |
""" | |
return os.environ.get('PYTHONHOME', '').find('.heroku') != -1 |
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
""" | |
Simple view decorator for flask and mongoengine/pymongo to auto-retry with delay on | |
pymongo.errors.AutoReconnect exception. | |
""" | |
from functools import wraps | |
import time | |
from pymongo.errors import AutoReconnect | |
import flask |
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
#============================================================== | |
# .picasa.ini FILE STRUCTURE | |
# | |
# reverse-engineered by Franz Buchinger <[email protected]> | |
# licensed to the public domain | |
# | |
# Picasa Version(s): 3.8.0 | |
# | |
# Changelog: | |
# v0.1: initial release |