Skip to content

Instantly share code, notes, and snippets.

@jwheat
jwheat / deep_speech_predictions.py
Created May 9, 2020 20:02
Rasa voice-to-text test script for Deepspeech 0.6.0
import pyaudio
from deepspeech import Model
import scipy.io.wavfile as wav
import wave
WAVE_OUTPUT_FILENAME = "test_audio.wav"
def record_audio(WAVE_OUTPUT_FILENAME):
CHUNK = 1024
@jwheat
jwheat / build-domain.py
Created September 26, 2019 15:19
Rasa domain Assembler
import os
import glob
import hiyapyco
path = 'data/domain'
yaml_list = []
for filename in glob.glob(os.path.join(path, '*.yml')):
with open(filename) as fp:
yaml_file = fp.read()
@jwheat
jwheat / BannerAds.js
Last active September 25, 2018 15:44
React Native rotating images (problem)
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View, Image } from "react-native";
import config from "../client/config.js";
import bannerimages from "../client/images/bannerads/index";
export default class BannerAds extends Component {
constructor(props) {
super(props);
@jwheat
jwheat / Home.js
Created September 10, 2018 20:56
React Native PouchDB replication problem
import React, { Component } from "react";
import { StyleSheet, Text, View, TouchableHighlight } from "react-native";
import Header from "../components/Header.js";
import HomeContent from "../components/HomeContent.js";
import Tabs from "../components/Tabs.js";
import config from "../client/config.js";
import SessionsList from "../screens/SessionsList";
@jwheat
jwheat / button-control.py
Created October 18, 2017 00:41
OctoPrint- Emergency Stop and Reprint Buttons
API = ""
import RPi.GPIO as GPIO
import time
import json
import requests
headers = {'X-Api-Key': API,"Content-Type":"application/json"}
GPIO.setmode(GPIO.BCM)