Skip to content

Instantly share code, notes, and snippets.

View kstohr's full-sized avatar

Kate Stohr kstohr

View GitHub Profile
@kstohr
kstohr / watson_stt_ws.py
Last active June 15, 2017 07:45
Watson Speech-to-Text Websocket Connection for Python 3.5 (function call)
# coding: utf-8
"""
websocket connection to watson speech-to-text API
adapted from: https://github.com/watson-developer-cloud/speech-to-text-websockets-python
speech recognition using the WebSocket interface to the Watson Speech-to-Text service
This is an updated version of the sample websocket connection created by the IBM Watson team (@daniel-bolanos) and included in their documentation.
Main changes:
@kstohr
kstohr / python_subprocess_output
Created August 1, 2017 10:28
Python subprocess to run a CLI python script in interactive mode
from subprocess import Popen, PIPE
cmd = 'python some_python_script.py'
p = subprocess.Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
stdout.splitlines()
@kstohr
kstohr / ydl-download-video-extract-audio
Last active October 16, 2017 23:47
Download video and extract audio using Youtube-DL
class MyLogger(object):
def debug(self, msg):
pass
def warning(self, msg):
pass
def error(self, msg):
#job = get_current_job()
#job.meta['progress'] = msg

SHORTCUTS

Key/Command Description
Tab Auto-complete files and folder names
Ctrl + A Go to the beginning of the line you are currently typing on
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + U Clear the line before the cursor
Ctrl + K Clear the line after the cursor
Ctrl + W Delete the word before the cursor
Ctrl + T Swap the last two characters before the cursor